]> git.lizzy.rs Git - rust.git/commitdiff
add many-seeds capabilities to CI
authorRalf Jung <post@ralfj.de>
Mon, 28 Nov 2022 07:48:49 +0000 (08:48 +0100)
committerRalf Jung <post@ralfj.de>
Mon, 28 Nov 2022 07:58:21 +0000 (08:58 +0100)
src/tools/miri/ci.sh
src/tools/miri/tests/many-seeds/scoped-thread-leak.rs [new file with mode: 0644]

index dd2d2abe35b539cff216bfabbd848718d8d3c8b1..e455b482338f4b7d4cd748b1bfa8f34f799e5ead 100755 (executable)
@@ -40,10 +40,15 @@ function run_tests {
   ./miri test
   if [ -z "${MIRI_TEST_TARGET+exists}" ]; then
     # Only for host architecture: tests with optimizations (`-O` is what cargo passes, but crank MIR
-    # optimizations up all the way).
-    # Optimizations change diagnostics (mostly backtraces), so we don't check them
-    #FIXME(#2155): we want to only run the pass and panic tests here, not the fail tests.
+    # optimizations up all the way, too).
+    # Optimizations change diagnostics (mostly backtraces), so we don't check
+    # them. Also error locations change so we don't run the failing tests.
     MIRIFLAGS="${MIRIFLAGS:-} -O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic}
+
+    # Also run some many-seeds tests. 64 seeds means this takes around a minute per test.
+    for FILE in tests/many-seeds/*.rs; do
+      MIRI_SEEDS=64 CARGO_EXTRA_FLAGS="$CARGO_EXTRA_FLAGS -q" ./miri many-seeds ./miri run "$FILE"
+    done
   fi
 
   ## test-cargo-miri
diff --git a/src/tools/miri/tests/many-seeds/scoped-thread-leak.rs b/src/tools/miri/tests/many-seeds/scoped-thread-leak.rs
new file mode 100644 (file)
index 0000000..f28e436
--- /dev/null
@@ -0,0 +1,8 @@
+//! Regression test for https://github.com/rust-lang/miri/issues/2629
+use std::thread;
+
+fn main() {
+    thread::scope(|s| {
+        s.spawn(|| {});
+    });
+}