Skip to content

Commit 4817c2c

Browse files
committed
Test with different sysroots dependent on the OS
1 parent c100c70 commit 4817c2c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ matrix:
4545
- os: linux
4646
env: BASE_TESTS=true
4747
- os: windows
48-
env: CARGO_INCREMENTAL=0 BASE_TESTS=true
48+
env: CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true
4949

5050
# Builds that are only executed when a PR is r+ed or a try build is started
5151
# We don't want to run these always because they go towards

ci/base-tests.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,16 @@ export CARGO_TARGET_DIR=`pwd`/target/
3131
sysroot=$(./target/debug/clippy-driver --print sysroot)
3232
test $sysroot = $(rustc --print sysroot)
3333

34-
sysroot=$(./target/debug/clippy-driver --sysroot /tmp --print sysroot)
35-
test $sysroot = /tmp
36-
37-
sysroot=$(SYSROOT=/tmp ./target/debug/clippy-driver --print sysroot)
38-
test $sysroot = /tmp
34+
if [ -z $OS_WINDOWS ]; then
35+
desired_sysroot=/tmp
36+
else
37+
desired_sysroot=C:/tmp
38+
fi
39+
sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
40+
test $sysroot = $desired_sysroot
41+
42+
sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
43+
test $sysroot = $desired_sysroot
3944

4045
# Make sure this isn't set - clippy-driver should cope without it
4146
unset CARGO_MANIFEST_DIR

0 commit comments

Comments
 (0)