Skip to content

Commit b531076

Browse files
adpaco-awstedinski
authored andcommitted
Move compiletest out of x.py (rust-lang#753)
* Move compiletest out of `x.py` * Fixups * Add `pwd` to `--build-base` and split cmd into several lines * Use correct mode for `rmc-docs` suite
1 parent 370f53f commit b531076

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

scripts/rmc-regression.sh

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ fi
88
set -o pipefail
99
set -o nounset
1010

11+
# Test for platform
12+
PLATFORM=$(uname -sp)
13+
if [[ $PLATFORM == "Linux x86_64" ]]
14+
then
15+
TARGET="x86_64-unknown-linux-gnu"
16+
elif [[ $PLATFORM == "Darwin i386" ]]
17+
then
18+
TARGET="x86_64-apple-darwin"
19+
fi
20+
1121
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1222
export PATH=$SCRIPT_DIR:$PATH
1323
EXTRA_X_PY_BUILD_ARGS="${EXTRA_X_PY_BUILD_ARGS:-}"
@@ -30,10 +40,36 @@ check-cbmc-viewer-version.py --major 2 --minor 5
3040
# Build tool for linking RMC pointer restrictions
3141
cargo build --release --manifest-path src/tools/rmc-link-restrictions/Cargo.toml
3242

33-
# Standalone rmc tests, expected tests, and cargo tests
34-
./x.py build -i src/tools/compiletest --stage 0
35-
export COMPILETEST_FORCE_STAGE0=1 # We don't care about the stage anymore. Remove this once we replace ./x.py test
36-
./x.py test -i --stage 0 rmc firecracker prusti smack expected cargo-rmc rmc-docs rmc-fixme
43+
# Build compiletest
44+
(cd "${RMC_DIR}/src/tools/compiletest"; cargo build --release)
45+
46+
# Declare testing suite information (suite and mode)
47+
TESTS=(
48+
"rmc rmc"
49+
"firecracker rmc"
50+
"prusti rmc"
51+
"smack rmc"
52+
"expected expected"
53+
"cargo-rmc cargo-rmc"
54+
"rmc-docs cargo-rmc"
55+
"rmc-fixme rmc-fixme"
56+
)
57+
58+
# Extract testing suite information and run compiletest
59+
for testp in "${TESTS[@]}"; do
60+
testl=($testp)
61+
suite=${testl[0]}
62+
mode=${testl[1]}
63+
echo "Check compiletest suite=$suite mode=$mode ($TARGET -> $TARGET)"
64+
# Note: `cargo-rmc` tests fail if we do not add `$(pwd)` to `--build-base`
65+
# Tracking issue: https://github.com/model-checking/rmc/issues/755
66+
./target/release/compiletest --rmc-dir-path scripts --src-base src/test/$suite \
67+
--build-base $(pwd)/build/$TARGET/test/$suite \
68+
--stage-id stage1-$TARGET \
69+
--suite $suite --mode $mode \
70+
--target $TARGET --host $TARGET \
71+
--quiet --channel dev
72+
done
3773

3874
# Check codegen for the standard library
3975
time "$SCRIPT_DIR"/std-lib-regression.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../rmc-compiler/rust-toolchain.toml

0 commit comments

Comments
 (0)