From f044205b5fab8b48a583f613f995519d6895e8ea Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 10 Dec 2018 10:04:55 +0100 Subject: [PATCH] the test suite assumes a libstd with full MIR; run test suite on xargo-built foreign libstds --- .travis.yml | 29 ++++++------- .../.gitignore | 0 .../Cargo.lock | 0 .../Cargo.toml | 0 .../run-test.py | 0 .../src/main.rs | 0 .../stderr.ref | 0 .../stdout.ref | 0 .../tests/foo.rs | 0 .../copy_nonoverlapping.rs | 0 .../deallocate-bad-alignment.rs | 0 .../deallocate-bad-size.rs | 0 .../deallocate-twice.rs | 0 .../memleak_rc.rs | 0 .../out_of_bounds_ptr_1.rs | 0 .../out_of_bounds_ptr_2.rs | 0 .../ptr_offset_overflow.rs | 0 .../reallocate-bad-size.rs | 0 .../reallocate-change-alloc.rs | 0 .../reallocate-dangling.rs | 0 .../stack_free.rs | 0 .../stacked_borrows/alias_through_mutation.rs | 0 .../stacked_borrows/aliasing_mut1.rs | 0 .../stacked_borrows/aliasing_mut2.rs | 0 .../stacked_borrows/aliasing_mut3.rs | 0 .../stacked_borrows/aliasing_mut4.rs | 0 .../box_exclusive_violation1.rs | 0 .../stacked_borrows/buggy_as_mut_slice.rs | 0 .../stacked_borrows/buggy_split_at_mut.rs | 0 .../deallocate_against_barrier.rs | 0 .../stacked_borrows/illegal_read1.rs | 0 .../stacked_borrows/illegal_read2.rs | 0 .../stacked_borrows/illegal_read3.rs | 0 .../stacked_borrows/illegal_read4.rs | 0 .../stacked_borrows/illegal_read5.rs | 0 .../stacked_borrows/illegal_write1.rs | 0 .../stacked_borrows/illegal_write2.rs | 0 .../stacked_borrows/illegal_write3.rs | 0 .../stacked_borrows/illegal_write4.rs | 0 .../stacked_borrows/illegal_write5.rs | 0 .../invalidate_against_barrier1.rs | 0 .../invalidate_against_barrier2.rs | 0 .../stacked_borrows/load_invalid_mut.rs | 0 .../stacked_borrows/load_invalid_shr.rs | 0 .../mut_exclusive_violation1.rs | 0 .../stacked_borrows/outdated_local.rs | 0 .../stacked_borrows/pass_invalid_mut.rs | 0 .../stacked_borrows/pass_invalid_shr.rs | 0 .../stacked_borrows/pointer_smuggling.rs | 0 .../stacked_borrows/return_invalid_mut.rs | 0 .../return_invalid_mut_option.rs | 0 .../return_invalid_mut_tuple.rs | 0 .../stacked_borrows/return_invalid_shr.rs | 0 .../return_invalid_shr_option.rs | 0 .../return_invalid_shr_tuple.rs | 0 .../stacked_borrows/shr_frozen_violation1.rs | 0 .../static_memory_modification.rs | 0 .../stacked_borrows/transmute-is-no-escape.rs | 0 .../stacked_borrows/unescaped_local.rs | 0 .../transmute-pair-undef.rs | 0 tests/compiletest.rs | 43 ++++--------------- .../async-fn.rs | 0 .../box-pair-to-vec.rs | 0 .../box-pair-to-vec.stdout | 0 tests/{run-pass-fullmir => run-pass}/catch.rs | 0 .../catch.stdout | 0 tests/{run-pass-fullmir => run-pass}/env.rs | 0 .../foreign-fn-linkname.rs | 0 .../{run-pass-fullmir => run-pass}/format.rs | 0 .../format.stdout | 0 .../from_utf8.rs | 0 .../{run-pass-fullmir => run-pass}/hashmap.rs | 0 tests/{run-pass-fullmir => run-pass}/hello.rs | 0 .../hello.stdout | 0 .../integer-ops.rs | 0 .../issue-3794.rs | 0 .../issue-3794.stdout | 0 .../loop-break-value.rs | 0 .../{run-pass-fullmir => run-pass}/memchr.rs | 0 .../send-is-not-static-par-for.rs | 0 .../{run-pass-fullmir => run-pass}/threads.rs | 0 tests/{run-pass-fullmir => run-pass}/u128.rs | 0 .../unsized-tuple-impls.rs | 0 .../vecdeque.rs | 0 84 files changed, 22 insertions(+), 50 deletions(-) rename {cargo-miri-test => test-cargo-miri}/.gitignore (100%) rename {cargo-miri-test => test-cargo-miri}/Cargo.lock (100%) rename {cargo-miri-test => test-cargo-miri}/Cargo.toml (100%) rename {cargo-miri-test => test-cargo-miri}/run-test.py (100%) rename {cargo-miri-test => test-cargo-miri}/src/main.rs (100%) rename {cargo-miri-test => test-cargo-miri}/stderr.ref (100%) rename {cargo-miri-test => test-cargo-miri}/stdout.ref (100%) rename {cargo-miri-test => test-cargo-miri}/tests/foo.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/copy_nonoverlapping.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/deallocate-bad-alignment.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/deallocate-bad-size.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/deallocate-twice.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/memleak_rc.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/out_of_bounds_ptr_1.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/out_of_bounds_ptr_2.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/ptr_offset_overflow.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/reallocate-bad-size.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/reallocate-change-alloc.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/reallocate-dangling.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stack_free.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/alias_through_mutation.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/aliasing_mut1.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/aliasing_mut2.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/aliasing_mut3.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/aliasing_mut4.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/box_exclusive_violation1.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/buggy_as_mut_slice.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/buggy_split_at_mut.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/deallocate_against_barrier.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_read1.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_read2.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_read3.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_read4.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_read5.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_write1.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_write2.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_write3.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_write4.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/illegal_write5.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/invalidate_against_barrier1.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/invalidate_against_barrier2.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/load_invalid_mut.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/load_invalid_shr.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/mut_exclusive_violation1.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/outdated_local.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/pass_invalid_mut.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/pass_invalid_shr.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/pointer_smuggling.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/return_invalid_mut.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/return_invalid_mut_option.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/return_invalid_mut_tuple.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/return_invalid_shr.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/return_invalid_shr_option.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/return_invalid_shr_tuple.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/shr_frozen_violation1.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/static_memory_modification.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/transmute-is-no-escape.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/stacked_borrows/unescaped_local.rs (100%) rename tests/{compile-fail-fullmir => compile-fail}/transmute-pair-undef.rs (100%) rename tests/{run-pass-fullmir => run-pass}/async-fn.rs (100%) rename tests/{run-pass-fullmir => run-pass}/box-pair-to-vec.rs (100%) rename tests/{run-pass-fullmir => run-pass}/box-pair-to-vec.stdout (100%) rename tests/{run-pass-fullmir => run-pass}/catch.rs (100%) rename tests/{run-pass-fullmir => run-pass}/catch.stdout (100%) rename tests/{run-pass-fullmir => run-pass}/env.rs (100%) rename tests/{run-pass-fullmir => run-pass}/foreign-fn-linkname.rs (100%) rename tests/{run-pass-fullmir => run-pass}/format.rs (100%) rename tests/{run-pass-fullmir => run-pass}/format.stdout (100%) rename tests/{run-pass-fullmir => run-pass}/from_utf8.rs (100%) rename tests/{run-pass-fullmir => run-pass}/hashmap.rs (100%) rename tests/{run-pass-fullmir => run-pass}/hello.rs (100%) rename tests/{run-pass-fullmir => run-pass}/hello.stdout (100%) rename tests/{run-pass-fullmir => run-pass}/integer-ops.rs (100%) rename tests/{run-pass-fullmir => run-pass}/issue-3794.rs (100%) rename tests/{run-pass-fullmir => run-pass}/issue-3794.stdout (100%) rename tests/{run-pass-fullmir => run-pass}/loop-break-value.rs (100%) rename tests/{run-pass-fullmir => run-pass}/memchr.rs (100%) rename tests/{run-pass-fullmir => run-pass}/send-is-not-static-par-for.rs (100%) rename tests/{run-pass-fullmir => run-pass}/threads.rs (100%) rename tests/{run-pass-fullmir => run-pass}/u128.rs (100%) rename tests/{run-pass-fullmir => run-pass}/unsized-tuple-impls.rs (100%) rename tests/{run-pass-fullmir => run-pass}/vecdeque.rs (100%) diff --git a/.travis.yml b/.travis.yml index ba3b8d363991..ac3f16ce1353 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,36 +20,35 @@ before_script: else RUST_TOOLCHAIN=$(cat rust-version) fi +- | + if [ "$TRAVIS_OS_NAME" == osx ]; then + export MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/ + else + export MIRI_SYSROOT_BASE=~/.cache/miri/HOST + fi # install Rust - curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" - export PATH=$HOME/.cargo/bin:$PATH - rustc --version -# customize installation -- rustup target add i686-unknown-linux-gnu -- rustup target add i686-pc-windows-gnu -- rustup target add i686-pc-windows-msvc script: - set -e - | - # Test and install plain miri + # Build and install miri cargo build --release --all-features --all-targets && - cargo test --release --all-features && cargo install --all-features --force --path . - | - # Get ourselves a MIR-full libstd, and use it henceforth + # Get ourselves a MIR-full libstd cargo miri setup && - if [ "$TRAVIS_OS_NAME" == osx ]; then - export MIRI_SYSROOT=~/Library/Caches/miri.miri.miri/HOST - else - export MIRI_SYSROOT=~/.cache/miri/HOST - fi + cargo miri setup --target i686-unknown-linux-gnu && + cargo miri setup --target i686-apple-darwin - | - # Test miri with full MIR - cargo test --release --all-features + # Test miri with full MIR, on the host and other architectures + MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST cargo test --release --all-features && + MIRI_SYSROOT=$MIRI_SYSROOT_BASE cargo test --release --all-features - | # Test cargo integration - (cd cargo-miri-test && ./run-test.py) + (cd test-cargo-miri && MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST ./run-test.py) notifications: email: diff --git a/cargo-miri-test/.gitignore b/test-cargo-miri/.gitignore similarity index 100% rename from cargo-miri-test/.gitignore rename to test-cargo-miri/.gitignore diff --git a/cargo-miri-test/Cargo.lock b/test-cargo-miri/Cargo.lock similarity index 100% rename from cargo-miri-test/Cargo.lock rename to test-cargo-miri/Cargo.lock diff --git a/cargo-miri-test/Cargo.toml b/test-cargo-miri/Cargo.toml similarity index 100% rename from cargo-miri-test/Cargo.toml rename to test-cargo-miri/Cargo.toml diff --git a/cargo-miri-test/run-test.py b/test-cargo-miri/run-test.py similarity index 100% rename from cargo-miri-test/run-test.py rename to test-cargo-miri/run-test.py diff --git a/cargo-miri-test/src/main.rs b/test-cargo-miri/src/main.rs similarity index 100% rename from cargo-miri-test/src/main.rs rename to test-cargo-miri/src/main.rs diff --git a/cargo-miri-test/stderr.ref b/test-cargo-miri/stderr.ref similarity index 100% rename from cargo-miri-test/stderr.ref rename to test-cargo-miri/stderr.ref diff --git a/cargo-miri-test/stdout.ref b/test-cargo-miri/stdout.ref similarity index 100% rename from cargo-miri-test/stdout.ref rename to test-cargo-miri/stdout.ref diff --git a/cargo-miri-test/tests/foo.rs b/test-cargo-miri/tests/foo.rs similarity index 100% rename from cargo-miri-test/tests/foo.rs rename to test-cargo-miri/tests/foo.rs diff --git a/tests/compile-fail-fullmir/copy_nonoverlapping.rs b/tests/compile-fail/copy_nonoverlapping.rs similarity index 100% rename from tests/compile-fail-fullmir/copy_nonoverlapping.rs rename to tests/compile-fail/copy_nonoverlapping.rs diff --git a/tests/compile-fail-fullmir/deallocate-bad-alignment.rs b/tests/compile-fail/deallocate-bad-alignment.rs similarity index 100% rename from tests/compile-fail-fullmir/deallocate-bad-alignment.rs rename to tests/compile-fail/deallocate-bad-alignment.rs diff --git a/tests/compile-fail-fullmir/deallocate-bad-size.rs b/tests/compile-fail/deallocate-bad-size.rs similarity index 100% rename from tests/compile-fail-fullmir/deallocate-bad-size.rs rename to tests/compile-fail/deallocate-bad-size.rs diff --git a/tests/compile-fail-fullmir/deallocate-twice.rs b/tests/compile-fail/deallocate-twice.rs similarity index 100% rename from tests/compile-fail-fullmir/deallocate-twice.rs rename to tests/compile-fail/deallocate-twice.rs diff --git a/tests/compile-fail-fullmir/memleak_rc.rs b/tests/compile-fail/memleak_rc.rs similarity index 100% rename from tests/compile-fail-fullmir/memleak_rc.rs rename to tests/compile-fail/memleak_rc.rs diff --git a/tests/compile-fail-fullmir/out_of_bounds_ptr_1.rs b/tests/compile-fail/out_of_bounds_ptr_1.rs similarity index 100% rename from tests/compile-fail-fullmir/out_of_bounds_ptr_1.rs rename to tests/compile-fail/out_of_bounds_ptr_1.rs diff --git a/tests/compile-fail-fullmir/out_of_bounds_ptr_2.rs b/tests/compile-fail/out_of_bounds_ptr_2.rs similarity index 100% rename from tests/compile-fail-fullmir/out_of_bounds_ptr_2.rs rename to tests/compile-fail/out_of_bounds_ptr_2.rs diff --git a/tests/compile-fail-fullmir/ptr_offset_overflow.rs b/tests/compile-fail/ptr_offset_overflow.rs similarity index 100% rename from tests/compile-fail-fullmir/ptr_offset_overflow.rs rename to tests/compile-fail/ptr_offset_overflow.rs diff --git a/tests/compile-fail-fullmir/reallocate-bad-size.rs b/tests/compile-fail/reallocate-bad-size.rs similarity index 100% rename from tests/compile-fail-fullmir/reallocate-bad-size.rs rename to tests/compile-fail/reallocate-bad-size.rs diff --git a/tests/compile-fail-fullmir/reallocate-change-alloc.rs b/tests/compile-fail/reallocate-change-alloc.rs similarity index 100% rename from tests/compile-fail-fullmir/reallocate-change-alloc.rs rename to tests/compile-fail/reallocate-change-alloc.rs diff --git a/tests/compile-fail-fullmir/reallocate-dangling.rs b/tests/compile-fail/reallocate-dangling.rs similarity index 100% rename from tests/compile-fail-fullmir/reallocate-dangling.rs rename to tests/compile-fail/reallocate-dangling.rs diff --git a/tests/compile-fail-fullmir/stack_free.rs b/tests/compile-fail/stack_free.rs similarity index 100% rename from tests/compile-fail-fullmir/stack_free.rs rename to tests/compile-fail/stack_free.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/alias_through_mutation.rs b/tests/compile-fail/stacked_borrows/alias_through_mutation.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/alias_through_mutation.rs rename to tests/compile-fail/stacked_borrows/alias_through_mutation.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/aliasing_mut1.rs b/tests/compile-fail/stacked_borrows/aliasing_mut1.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/aliasing_mut1.rs rename to tests/compile-fail/stacked_borrows/aliasing_mut1.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/aliasing_mut2.rs b/tests/compile-fail/stacked_borrows/aliasing_mut2.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/aliasing_mut2.rs rename to tests/compile-fail/stacked_borrows/aliasing_mut2.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/aliasing_mut3.rs b/tests/compile-fail/stacked_borrows/aliasing_mut3.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/aliasing_mut3.rs rename to tests/compile-fail/stacked_borrows/aliasing_mut3.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/aliasing_mut4.rs b/tests/compile-fail/stacked_borrows/aliasing_mut4.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/aliasing_mut4.rs rename to tests/compile-fail/stacked_borrows/aliasing_mut4.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/box_exclusive_violation1.rs b/tests/compile-fail/stacked_borrows/box_exclusive_violation1.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/box_exclusive_violation1.rs rename to tests/compile-fail/stacked_borrows/box_exclusive_violation1.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/buggy_as_mut_slice.rs b/tests/compile-fail/stacked_borrows/buggy_as_mut_slice.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/buggy_as_mut_slice.rs rename to tests/compile-fail/stacked_borrows/buggy_as_mut_slice.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/buggy_split_at_mut.rs b/tests/compile-fail/stacked_borrows/buggy_split_at_mut.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/buggy_split_at_mut.rs rename to tests/compile-fail/stacked_borrows/buggy_split_at_mut.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/deallocate_against_barrier.rs b/tests/compile-fail/stacked_borrows/deallocate_against_barrier.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/deallocate_against_barrier.rs rename to tests/compile-fail/stacked_borrows/deallocate_against_barrier.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_read1.rs b/tests/compile-fail/stacked_borrows/illegal_read1.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_read1.rs rename to tests/compile-fail/stacked_borrows/illegal_read1.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_read2.rs b/tests/compile-fail/stacked_borrows/illegal_read2.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_read2.rs rename to tests/compile-fail/stacked_borrows/illegal_read2.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_read3.rs b/tests/compile-fail/stacked_borrows/illegal_read3.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_read3.rs rename to tests/compile-fail/stacked_borrows/illegal_read3.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_read4.rs b/tests/compile-fail/stacked_borrows/illegal_read4.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_read4.rs rename to tests/compile-fail/stacked_borrows/illegal_read4.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_read5.rs b/tests/compile-fail/stacked_borrows/illegal_read5.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_read5.rs rename to tests/compile-fail/stacked_borrows/illegal_read5.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_write1.rs b/tests/compile-fail/stacked_borrows/illegal_write1.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_write1.rs rename to tests/compile-fail/stacked_borrows/illegal_write1.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_write2.rs b/tests/compile-fail/stacked_borrows/illegal_write2.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_write2.rs rename to tests/compile-fail/stacked_borrows/illegal_write2.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_write3.rs b/tests/compile-fail/stacked_borrows/illegal_write3.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_write3.rs rename to tests/compile-fail/stacked_borrows/illegal_write3.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_write4.rs b/tests/compile-fail/stacked_borrows/illegal_write4.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_write4.rs rename to tests/compile-fail/stacked_borrows/illegal_write4.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/illegal_write5.rs b/tests/compile-fail/stacked_borrows/illegal_write5.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/illegal_write5.rs rename to tests/compile-fail/stacked_borrows/illegal_write5.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/invalidate_against_barrier1.rs b/tests/compile-fail/stacked_borrows/invalidate_against_barrier1.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/invalidate_against_barrier1.rs rename to tests/compile-fail/stacked_borrows/invalidate_against_barrier1.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/invalidate_against_barrier2.rs b/tests/compile-fail/stacked_borrows/invalidate_against_barrier2.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/invalidate_against_barrier2.rs rename to tests/compile-fail/stacked_borrows/invalidate_against_barrier2.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/load_invalid_mut.rs b/tests/compile-fail/stacked_borrows/load_invalid_mut.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/load_invalid_mut.rs rename to tests/compile-fail/stacked_borrows/load_invalid_mut.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/load_invalid_shr.rs b/tests/compile-fail/stacked_borrows/load_invalid_shr.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/load_invalid_shr.rs rename to tests/compile-fail/stacked_borrows/load_invalid_shr.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/mut_exclusive_violation1.rs b/tests/compile-fail/stacked_borrows/mut_exclusive_violation1.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/mut_exclusive_violation1.rs rename to tests/compile-fail/stacked_borrows/mut_exclusive_violation1.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/outdated_local.rs b/tests/compile-fail/stacked_borrows/outdated_local.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/outdated_local.rs rename to tests/compile-fail/stacked_borrows/outdated_local.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/pass_invalid_mut.rs b/tests/compile-fail/stacked_borrows/pass_invalid_mut.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/pass_invalid_mut.rs rename to tests/compile-fail/stacked_borrows/pass_invalid_mut.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/pass_invalid_shr.rs b/tests/compile-fail/stacked_borrows/pass_invalid_shr.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/pass_invalid_shr.rs rename to tests/compile-fail/stacked_borrows/pass_invalid_shr.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/pointer_smuggling.rs b/tests/compile-fail/stacked_borrows/pointer_smuggling.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/pointer_smuggling.rs rename to tests/compile-fail/stacked_borrows/pointer_smuggling.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/return_invalid_mut.rs b/tests/compile-fail/stacked_borrows/return_invalid_mut.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/return_invalid_mut.rs rename to tests/compile-fail/stacked_borrows/return_invalid_mut.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/return_invalid_mut_option.rs b/tests/compile-fail/stacked_borrows/return_invalid_mut_option.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/return_invalid_mut_option.rs rename to tests/compile-fail/stacked_borrows/return_invalid_mut_option.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/return_invalid_mut_tuple.rs b/tests/compile-fail/stacked_borrows/return_invalid_mut_tuple.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/return_invalid_mut_tuple.rs rename to tests/compile-fail/stacked_borrows/return_invalid_mut_tuple.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/return_invalid_shr.rs b/tests/compile-fail/stacked_borrows/return_invalid_shr.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/return_invalid_shr.rs rename to tests/compile-fail/stacked_borrows/return_invalid_shr.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/return_invalid_shr_option.rs b/tests/compile-fail/stacked_borrows/return_invalid_shr_option.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/return_invalid_shr_option.rs rename to tests/compile-fail/stacked_borrows/return_invalid_shr_option.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/return_invalid_shr_tuple.rs b/tests/compile-fail/stacked_borrows/return_invalid_shr_tuple.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/return_invalid_shr_tuple.rs rename to tests/compile-fail/stacked_borrows/return_invalid_shr_tuple.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/shr_frozen_violation1.rs b/tests/compile-fail/stacked_borrows/shr_frozen_violation1.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/shr_frozen_violation1.rs rename to tests/compile-fail/stacked_borrows/shr_frozen_violation1.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/static_memory_modification.rs b/tests/compile-fail/stacked_borrows/static_memory_modification.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/static_memory_modification.rs rename to tests/compile-fail/stacked_borrows/static_memory_modification.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/transmute-is-no-escape.rs b/tests/compile-fail/stacked_borrows/transmute-is-no-escape.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/transmute-is-no-escape.rs rename to tests/compile-fail/stacked_borrows/transmute-is-no-escape.rs diff --git a/tests/compile-fail-fullmir/stacked_borrows/unescaped_local.rs b/tests/compile-fail/stacked_borrows/unescaped_local.rs similarity index 100% rename from tests/compile-fail-fullmir/stacked_borrows/unescaped_local.rs rename to tests/compile-fail/stacked_borrows/unescaped_local.rs diff --git a/tests/compile-fail-fullmir/transmute-pair-undef.rs b/tests/compile-fail/transmute-pair-undef.rs similarity index 100% rename from tests/compile-fail-fullmir/transmute-pair-undef.rs rename to tests/compile-fail/transmute-pair-undef.rs diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 1c11d07c1bcc..f0ebbf6b071b 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -1,4 +1,5 @@ #![feature(slice_concat_ext, custom_test_frameworks)] +// Custom test runner, to avoid libtest being wrapped around compiletest which wraps libtest. #![test_runner(test_runner)] use std::slice::SliceConcatExt; @@ -24,11 +25,6 @@ fn rustc_lib_path() -> PathBuf { option_env!("RUSTC_LIB_PATH").unwrap().into() } -fn have_fullmir() -> bool { - // We assume we have full MIR when MIRI_SYSROOT is set or when we are in rustc - std::env::var("MIRI_SYSROOT").is_ok() || rustc_test_suite().is_some() -} - fn mk_config(mode: &str) -> compiletest::common::ConfigWithTemp { let mut config = compiletest::Config::default().tempdir(); config.mode = mode.parse().expect("Invalid mode"); @@ -41,16 +37,7 @@ fn mk_config(mode: &str) -> compiletest::common::ConfigWithTemp { config } -fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir: bool, opt: bool) { - if need_fullmir && !have_fullmir() { - eprintln!("{}\n", format!( - "## Skipping compile-fail tests in {} against miri for target {} due to missing mir", - path, - target - ).yellow().bold()); - return; - } - +fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, opt: bool) { let opt_str = if opt { " with optimizations" } else { "" }; eprintln!("{}", format!( "## Running compile-fail tests in {} against miri for target {}{}", @@ -78,16 +65,7 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, need_fullm compiletest::run_tests(&config); } -fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir: bool, opt: bool) { - if need_fullmir && !have_fullmir() { - eprintln!("{}\n", format!( - "## Skipping run-pass tests in {} against miri for target {} due to missing mir", - path, - target - ).yellow().bold()); - return; - } - +fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, opt: bool) { let opt_str = if opt { " with optimizations" } else { "" }; eprintln!("{}", format!( "## Running run-pass tests in {} against miri for target {}{}", @@ -105,10 +83,6 @@ fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir: // whitelist. flags.push("-Zmir-opt-level=1".to_owned()); } - if !have_fullmir() { - // FIXME: Validation relies on the EscapeToRaw statements being emitted - flags.push("-Zmiri-disable-validation".to_owned()); - } let mut config = mk_config("ui"); config.src_base = PathBuf::from(path); @@ -132,7 +106,7 @@ fn target_has_std>(path: P) -> bool { .map(|entry| entry.unwrap()) .filter(|entry| entry.file_type().unwrap().is_file()) .filter_map(|entry| entry.file_name().into_string().ok()) - .any(|file_name| file_name.starts_with("libstd") && file_name.ends_with(".rlib")) + .any(|file_name| file_name == "libstd.rlib") } @@ -186,18 +160,17 @@ fn run_pass_miri(opt: bool) { let host = get_host(); for_all_targets(&sysroot, |target| { - miri_pass(&sysroot, "tests/run-pass", &target, &host, false, opt); + miri_pass(&sysroot, "tests/run-pass", &target, &host, opt); }); - miri_pass(&sysroot, "tests/run-pass-fullmir", &host, &host, true, opt); } fn compile_fail_miri(opt: bool) { let sysroot = get_sysroot(); let host = get_host(); - // FIXME: run tests for other targets, too - compile_fail(&sysroot, "tests/compile-fail", &host, &host, false, opt); - compile_fail(&sysroot, "tests/compile-fail-fullmir", &host, &host, true, opt); + for_all_targets(&sysroot, |target| { + compile_fail(&sysroot, "tests/compile-fail", &target, &host, opt); + }); } fn test_runner(_tests: &[&()]) { diff --git a/tests/run-pass-fullmir/async-fn.rs b/tests/run-pass/async-fn.rs similarity index 100% rename from tests/run-pass-fullmir/async-fn.rs rename to tests/run-pass/async-fn.rs diff --git a/tests/run-pass-fullmir/box-pair-to-vec.rs b/tests/run-pass/box-pair-to-vec.rs similarity index 100% rename from tests/run-pass-fullmir/box-pair-to-vec.rs rename to tests/run-pass/box-pair-to-vec.rs diff --git a/tests/run-pass-fullmir/box-pair-to-vec.stdout b/tests/run-pass/box-pair-to-vec.stdout similarity index 100% rename from tests/run-pass-fullmir/box-pair-to-vec.stdout rename to tests/run-pass/box-pair-to-vec.stdout diff --git a/tests/run-pass-fullmir/catch.rs b/tests/run-pass/catch.rs similarity index 100% rename from tests/run-pass-fullmir/catch.rs rename to tests/run-pass/catch.rs diff --git a/tests/run-pass-fullmir/catch.stdout b/tests/run-pass/catch.stdout similarity index 100% rename from tests/run-pass-fullmir/catch.stdout rename to tests/run-pass/catch.stdout diff --git a/tests/run-pass-fullmir/env.rs b/tests/run-pass/env.rs similarity index 100% rename from tests/run-pass-fullmir/env.rs rename to tests/run-pass/env.rs diff --git a/tests/run-pass-fullmir/foreign-fn-linkname.rs b/tests/run-pass/foreign-fn-linkname.rs similarity index 100% rename from tests/run-pass-fullmir/foreign-fn-linkname.rs rename to tests/run-pass/foreign-fn-linkname.rs diff --git a/tests/run-pass-fullmir/format.rs b/tests/run-pass/format.rs similarity index 100% rename from tests/run-pass-fullmir/format.rs rename to tests/run-pass/format.rs diff --git a/tests/run-pass-fullmir/format.stdout b/tests/run-pass/format.stdout similarity index 100% rename from tests/run-pass-fullmir/format.stdout rename to tests/run-pass/format.stdout diff --git a/tests/run-pass-fullmir/from_utf8.rs b/tests/run-pass/from_utf8.rs similarity index 100% rename from tests/run-pass-fullmir/from_utf8.rs rename to tests/run-pass/from_utf8.rs diff --git a/tests/run-pass-fullmir/hashmap.rs b/tests/run-pass/hashmap.rs similarity index 100% rename from tests/run-pass-fullmir/hashmap.rs rename to tests/run-pass/hashmap.rs diff --git a/tests/run-pass-fullmir/hello.rs b/tests/run-pass/hello.rs similarity index 100% rename from tests/run-pass-fullmir/hello.rs rename to tests/run-pass/hello.rs diff --git a/tests/run-pass-fullmir/hello.stdout b/tests/run-pass/hello.stdout similarity index 100% rename from tests/run-pass-fullmir/hello.stdout rename to tests/run-pass/hello.stdout diff --git a/tests/run-pass-fullmir/integer-ops.rs b/tests/run-pass/integer-ops.rs similarity index 100% rename from tests/run-pass-fullmir/integer-ops.rs rename to tests/run-pass/integer-ops.rs diff --git a/tests/run-pass-fullmir/issue-3794.rs b/tests/run-pass/issue-3794.rs similarity index 100% rename from tests/run-pass-fullmir/issue-3794.rs rename to tests/run-pass/issue-3794.rs diff --git a/tests/run-pass-fullmir/issue-3794.stdout b/tests/run-pass/issue-3794.stdout similarity index 100% rename from tests/run-pass-fullmir/issue-3794.stdout rename to tests/run-pass/issue-3794.stdout diff --git a/tests/run-pass-fullmir/loop-break-value.rs b/tests/run-pass/loop-break-value.rs similarity index 100% rename from tests/run-pass-fullmir/loop-break-value.rs rename to tests/run-pass/loop-break-value.rs diff --git a/tests/run-pass-fullmir/memchr.rs b/tests/run-pass/memchr.rs similarity index 100% rename from tests/run-pass-fullmir/memchr.rs rename to tests/run-pass/memchr.rs diff --git a/tests/run-pass-fullmir/send-is-not-static-par-for.rs b/tests/run-pass/send-is-not-static-par-for.rs similarity index 100% rename from tests/run-pass-fullmir/send-is-not-static-par-for.rs rename to tests/run-pass/send-is-not-static-par-for.rs diff --git a/tests/run-pass-fullmir/threads.rs b/tests/run-pass/threads.rs similarity index 100% rename from tests/run-pass-fullmir/threads.rs rename to tests/run-pass/threads.rs diff --git a/tests/run-pass-fullmir/u128.rs b/tests/run-pass/u128.rs similarity index 100% rename from tests/run-pass-fullmir/u128.rs rename to tests/run-pass/u128.rs diff --git a/tests/run-pass-fullmir/unsized-tuple-impls.rs b/tests/run-pass/unsized-tuple-impls.rs similarity index 100% rename from tests/run-pass-fullmir/unsized-tuple-impls.rs rename to tests/run-pass/unsized-tuple-impls.rs diff --git a/tests/run-pass-fullmir/vecdeque.rs b/tests/run-pass/vecdeque.rs similarity index 100% rename from tests/run-pass-fullmir/vecdeque.rs rename to tests/run-pass/vecdeque.rs