Skip to content

Commit a0edbfb

Browse files
committed
Test to fix UI tests
1 parent e9708eb commit a0edbfb

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

test.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ function setup_rustc() {
213213

214214
rm config.toml || true
215215

216+
# TODO: copy in build_sysroot/build_sysroot.sh instead to avoid having to rebuild stage0 libraries everytime?
217+
my_toolchain_dir=$HOME/.rustup/toolchains/my_toolchain
218+
rm -rf $my_toolchain_dir
219+
cp -r $HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE $my_toolchain_dir
220+
rm -rf $my_toolchain_dir/lib/rustlib/x86_64-unknown-linux-gnu/
221+
cp -r ../build_sysroot/sysroot/* $my_toolchain_dir
222+
216223
cat > config.toml <<EOF
217224
changelog-seen = 2
218225
@@ -221,9 +228,11 @@ codegen-backends = []
221228
deny-warnings = false
222229
223230
[build]
224-
cargo = "$(rustup which cargo)"
231+
cargo = "$my_toolchain_dir/bin/cargo"
232+
#cargo = "$(rustup which cargo)"
225233
local-rebuild = true
226-
rustc = "$HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE/bin/rustc"
234+
rustc = "$my_toolchain_dir/bin/rustc"
235+
#rustc = "$HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE/bin/rustc"
227236
228237
[target.x86_64-unknown-linux-gnu]
229238
llvm-filecheck = "`which FileCheck-10 || which FileCheck-11 || which FileCheck-12 || which FileCheck-13 || which FileCheck-14`"
@@ -361,7 +370,9 @@ function test_rustc() {
361370
#done
362371

363372
# TODO: copy the sysroot at the correct location to not have to use the --sysroot flag.
364-
RUSTC_ARGS="$TEST_FLAGS -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot"
373+
#RUSTC_ARGS="$TEST_FLAGS -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext""
374+
RUSTC_ARGS="$TEST_FLAGS -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot $HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE/bin/rustc"
375+
365376

366377
if [ $# -eq 0 ]; then
367378
# No argument supplied to the function. Doing nothing.
@@ -393,7 +404,8 @@ function test_rustc() {
393404
fi
394405

395406
echo "[TEST] rustc test suite"
396-
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui/ --rustc-args "$RUSTC_ARGS"
407+
#COMPILETEST_FORCE_STAGE0=1 strace -f ./x.py test --run always --stage 0 tests/ui/ --rustc-args "$RUSTC_ARGS" &> ../trace
408+
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui/zero-sized/zero-sized-linkedlist-push.rs --rustc-args "$RUSTC_ARGS"
397409
}
398410

399411
function test_failing_rustc() {

0 commit comments

Comments
 (0)