@@ -71,14 +71,20 @@ function base_sysroot_tests() {
7171 echo " [AOT] mod_bench"
7272 $MY_RUSTC example/mod_bench.rs --crate-type bin --target " $TARGET_TRIPLE "
7373 $RUN_WRAPPER ./target/out/mod_bench
74+ }
7475
76+ function extended_sysroot_tests() {
7577 pushd rand
76- rm -r ./target || true
77- ../build/cargo.sh test --workspace
78+ cargo clean
79+ if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
80+ echo " [TEST] rust-random/rand"
81+ ../build/cargo.sh test --workspace
82+ else
83+ echo " [AOT] rust-random/rand"
84+ ../build/cargo.sh build --workspace --target $TARGET_TRIPLE --tests
85+ fi
7886 popd
79- }
8087
81- function extended_sysroot_tests() {
8288 pushd simple-raytracer
8389 if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
8490 echo " [BENCH COMPILE] ebobby/simple-raytracer"
@@ -92,27 +98,40 @@ function extended_sysroot_tests() {
9298 else
9399 echo " [BENCH COMPILE] ebobby/simple-raytracer (skipped)"
94100 echo " [COMPILE] ebobby/simple-raytracer"
95- ../cargo.sh build
101+ ../build/ cargo.sh build --target $TARGET_TRIPLE
96102 echo " [BENCH RUN] ebobby/simple-raytracer (skipped)"
97103 fi
98104 popd
99105
100106 pushd build_sysroot/sysroot_src/library/core/tests
101107 echo " [TEST] libcore"
102- rm -r ./target || true
103- ../../../../../build/cargo.sh test
108+ cargo clean
109+ if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
110+ ../../../../../build/cargo.sh test
111+ else
112+ ../../../../../build/cargo.sh build --target $TARGET_TRIPLE --tests
113+ fi
104114 popd
105115
106116 pushd regex
107117 echo " [TEST] rust-lang/regex example shootout-regex-dna"
108- ../build/ cargo.sh clean
118+ cargo clean
109119 # Make sure `[codegen mono items] start` doesn't poison the diff
110- ../build/cargo.sh build --example shootout-regex-dna
111- cat examples/regexdna-input.txt | ../build/cargo.sh run --example shootout-regex-dna | grep -v " Spawned thread" > res.txt
112- diff -u res.txt examples/regexdna-output.txt
120+ ../build/cargo.sh build --example shootout-regex-dna --target $TARGET_TRIPLE
121+ if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
122+ cat examples/regexdna-input.txt \
123+ | ../build/cargo.sh run --example shootout-regex-dna --target $TARGET_TRIPLE \
124+ | grep -v " Spawned thread" > res.txt
125+ diff -u res.txt examples/regexdna-output.txt
126+ fi
113127
114- echo " [TEST] rust-lang/regex tests"
115- ../build/cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options -q
128+ if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
129+ echo " [TEST] rust-lang/regex tests"
130+ ../build/cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options -q
131+ else
132+ echo " [AOT] rust-lang/regex tests"
133+ ../build/cargo.sh build --tests --target $TARGET_TRIPLE
134+ fi
116135 popd
117136}
118137
0 commit comments