-
Notifications
You must be signed in to change notification settings - Fork 49
/
testsuite_regenerate
executable file
·38 lines (34 loc) · 1.12 KB
/
testsuite_regenerate
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
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <STRATEGY> [path/to/test.coma]"
echo "STRATEGY is the strategy to use, for example Auto_level_2"
echo "If no path to a specific coma file is passed, tries to regenerate all tests in the testsuite"
echo "If a path to a coma file is passed, tries to regenerate this test only"
exit 1
fi
eval $(cargo run --bin dev-env)
if [ -z "$2" ]; then
# upgrade all
failed=()
shopt -s globstar
for file in creusot/tests/**/*.coma; do
# only try to upgrade if it looks like there is a session directory
SESSION_DIR="$(dirname $file)/$(basename $file .coma)"
if [ -d "$SESSION_DIR" ]; then
echo "==> Regenerating $file"
why3_tools regenerate -L. "$file" "$1"
if [ $? != 0 ]; then
failed+=("$file")
fi
fi
done
if [ ${#failed[@]} != 0 ]; then
echo ""
echo "Failed to regenerate the following tests:"
printf "%s\n" "${failed[@]}"
fi
else
# upgrade a specific test
echo "==> Regenerating $2"
why3_tools regenerate -L. "$2" "$1"
fi