@@ -71,14 +71,20 @@ function base_sysroot_tests() {
71
71
echo " [AOT] mod_bench"
72
72
$MY_RUSTC example/mod_bench.rs --crate-type bin --target " $TARGET_TRIPLE "
73
73
$RUN_WRAPPER ./target/out/mod_bench
74
+ }
74
75
76
+ function extended_sysroot_tests() {
75
77
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
78
86
popd
79
- }
80
87
81
- function extended_sysroot_tests() {
82
88
pushd simple-raytracer
83
89
if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
84
90
echo " [BENCH COMPILE] ebobby/simple-raytracer"
@@ -92,27 +98,40 @@ function extended_sysroot_tests() {
92
98
else
93
99
echo " [BENCH COMPILE] ebobby/simple-raytracer (skipped)"
94
100
echo " [COMPILE] ebobby/simple-raytracer"
95
- ../cargo.sh build
101
+ ../build/ cargo.sh build --target $TARGET_TRIPLE
96
102
echo " [BENCH RUN] ebobby/simple-raytracer (skipped)"
97
103
fi
98
104
popd
99
105
100
106
pushd build_sysroot/sysroot_src/library/core/tests
101
107
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
104
114
popd
105
115
106
116
pushd regex
107
117
echo " [TEST] rust-lang/regex example shootout-regex-dna"
108
- ../build/ cargo.sh clean
118
+ cargo clean
109
119
# 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
113
127
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
116
135
popd
117
136
}
118
137
0 commit comments