-
Notifications
You must be signed in to change notification settings - Fork 69
/
ci-test.sh
executable file
·42 lines (33 loc) · 1.34 KB
/
ci-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
. $(dirname "$0")/ci-common.sh
export RUST_BACKTRACE=1
# Run all tests with 1G heap
export MMTK_GC_TRIGGER=FixedHeapSize:1000000000
for_all_features "cargo test"
# target-specific features
if [[ $arch == "x86_64" && $os == "linux" ]]; then
cargo test --features perf_counter
fi
ALL_PLANS=$(sed -n '/enum PlanSelector/,/}/p' src/util/options.rs | sed -e 's;//.*;;g' -e '/^$/d' -e 's/,//g' | xargs | grep -o '{.*}' | grep -o '\w\+')
# Test with mock VM:
# - Find all the files that start with mock_test_
# - Run each file separately with cargo test, with the feature 'mock_test'
find ./src ./tests -type f -name "mock_test_*" | while read -r file; do
t=$(basename -s .rs $file)
# Get the required plans.
# Some tests need to be run with multiple plans because
# some bugs can only be reproduced in some plans but not others.
PLANS=$(sed -n 's/^\/\/ *GITHUB-CI: *MMTK_PLAN=//p' $file)
if [[ $PLANS == 'all' ]]; then
PLANS=$ALL_PLANS
elif [[ -z $PLANS ]]; then
PLANS=NoGC
fi
# Some tests need some features enabled.
FEATURES=$(sed -n 's/^\/\/ *GITHUB-CI: *FEATURES=//p' $file)
# Run the test with each plan it needs.
for MMTK_PLAN in $PLANS; do
env MMTK_PLAN=$MMTK_PLAN cargo test --features mock_test,"$FEATURES" -- $t;
done
done
# Test the dummy VM
cargo test --manifest-path $dummyvm_toml