Skip to content

Commit

Permalink
regression test for 66530.
Browse files Browse the repository at this point in the history
it uses normalize-stderr-test because not all targets hit the same OS error number nor message ...

... and ignores tidy since I dont know how to make the normalize line shorter ...

and has effectively a no-op for its error-pattern because the targets' error
messages are so wildly different (and the error-pattern check occurs *before*
stderr normalization.)
  • Loading branch information
pnkfelix committed Dec 31, 2019
1 parent 0435c1b commit 7c5cff7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/test/ui/non-ice-error-on-worker-io-fail.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Issue #66530: We would ICE if someone compiled with `-o /dev/null`,
// because we would try to generate auxiliary files in `/dev/` (which
// at least the OS X file system rejects).
//
// An attempt to `-o` into a directory we cannot write into should indeed
// be an error; but not an ICE.

// compile-flags: -o /dev/null

// The error-pattern check occurs *before* normalization, and the error patterns
// are wildly different between build environments. So this is a cop-out (and we
// rely on the checking of the normalized stderr output as our actual
// "verification" of the diagnostic).

// error-pattern: error

// On Mac OS X, we get an error like the below
// normalize-stderr-test "failed to write bytecode to /dev/null.non_ice_error_on_worker_io_fail.*" -> "io error modifying /dev/"

// On Linux, we get an error like the below
// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /dev/"

// ignore-tidy-linelength
// ignore-windows - this is a unix-specific test
// ignore-emscripten - the file-system issues do not replicate here
// ignore-wasm - the file-system issues do not replicate here

#![crate_type="lib"]

#![cfg_attr(not(feature = "std"), no_std)]
pub mod task {
pub mod __internal {
use crate::task::Waker;
}
pub use core::task::Waker;
}
6 changes: 6 additions & 0 deletions src/test/ui/non-ice-error-on-worker-io-fail.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
warning: ignoring --out-dir flag due to -o flag

error: io error modifying /dev/

error: aborting due to previous error

0 comments on commit 7c5cff7

Please sign in to comment.