diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2021-03-05 23:03:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-05 23:03:06 +0100 |
| commit | 274a7ac4c49c31bc87672fbbf5f1002c96fec1aa (patch) | |
| tree | 12fb297b2d3221774cdbaecbcfad74aca3bdcea1 /scripts | |
| parent | 9a0c32934ebe376128230aa8da3275697b2053e7 (diff) | |
| parent | 00f1cddb9c8ecd82ada4ea30430cb6cf178c50ba (diff) | |
| download | rust-274a7ac4c49c31bc87672fbbf5f1002c96fec1aa.tar.gz rust-274a7ac4c49c31bc87672fbbf5f1002c96fec1aa.zip | |
Merge pull request #1145 from bjorn3/mingw_support
Support cross-compiling to Windows using MinGW
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/tests.sh | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/scripts/tests.sh b/scripts/tests.sh index f9a9fb091fb..3afcea8f06b 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -71,14 +71,20 @@ function base_sysroot_tests() { echo "[AOT] mod_bench" $MY_RUSTC example/mod_bench.rs --crate-type bin --target "$TARGET_TRIPLE" $RUN_WRAPPER ./target/out/mod_bench +} +function extended_sysroot_tests() { pushd rand - rm -r ./target || true - ../build/cargo.sh test --workspace + cargo clean + if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then + echo "[TEST] rust-random/rand" + ../build/cargo.sh test --workspace + else + echo "[AOT] rust-random/rand" + ../build/cargo.sh build --workspace --target $TARGET_TRIPLE --tests + fi popd -} -function extended_sysroot_tests() { pushd simple-raytracer if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then echo "[BENCH COMPILE] ebobby/simple-raytracer" @@ -92,27 +98,40 @@ function extended_sysroot_tests() { else echo "[BENCH COMPILE] ebobby/simple-raytracer (skipped)" echo "[COMPILE] ebobby/simple-raytracer" - ../cargo.sh build + ../build/cargo.sh build --target $TARGET_TRIPLE echo "[BENCH RUN] ebobby/simple-raytracer (skipped)" fi popd pushd build_sysroot/sysroot_src/library/core/tests echo "[TEST] libcore" - rm -r ./target || true - ../../../../../build/cargo.sh test + cargo clean + if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then + ../../../../../build/cargo.sh test + else + ../../../../../build/cargo.sh build --target $TARGET_TRIPLE --tests + fi popd pushd regex echo "[TEST] rust-lang/regex example shootout-regex-dna" - ../build/cargo.sh clean + cargo clean # Make sure `[codegen mono items] start` doesn't poison the diff - ../build/cargo.sh build --example shootout-regex-dna - cat examples/regexdna-input.txt | ../build/cargo.sh run --example shootout-regex-dna | grep -v "Spawned thread" > res.txt - diff -u res.txt examples/regexdna-output.txt + ../build/cargo.sh build --example shootout-regex-dna --target $TARGET_TRIPLE + if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then + cat examples/regexdna-input.txt \ + | ../build/cargo.sh run --example shootout-regex-dna --target $TARGET_TRIPLE \ + | grep -v "Spawned thread" > res.txt + diff -u res.txt examples/regexdna-output.txt + fi - echo "[TEST] rust-lang/regex tests" - ../build/cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options -q + if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then + echo "[TEST] rust-lang/regex tests" + ../build/cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options -q + else + echo "[AOT] rust-lang/regex tests" + ../build/cargo.sh build --tests --target $TARGET_TRIPLE + fi popd } |
