-
Notifications
You must be signed in to change notification settings - Fork 325
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·77 lines (70 loc) · 1.68 KB
/
Copy pathrun_tests.sh
File metadata and controls
executable file
·77 lines (70 loc) · 1.68 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -eu
cd "$(dirname "$0")"
target_values=(raddbg raddbg_non_graphical radlink radbin torture)
cc_values=(clang gcc)
mode_values=(debug release)
run_torture=1
torture_args=()
while [[ $# -gt 0 ]]; do
case "$1" in
--)
shift
torture_args=("$@")
break
;;
clang)
cc_values=("$1")
shift
;;
gcc)
cc_values=("$1")
shift
;;
debug|release)
mode_values=("$1")
shift
;;
no_torture)
run_torture=0
shift
;;
*)
echo "usage: $0 [clang|gcc] [debug|release] [no_torture] [-- torture-args]"
exit 1
;;
esac
done
if [[ "${#torture_args[@]}" == "0" ]]; then
torture_args=("*")
fi
for m in "${mode_values[@]}"; do
for c in "${cc_values[@]}"; do
# nuke artifacts from last run
rm -rf build/torture_artifacts
rm -f build/metagen
for t in "${target_values[@]}"; do
rm -f "build/$t"
done
# build targets
./build.sh meta "$c" "$m" "${target_values[@]}"
# run torture from build folder
if [[ "$run_torture" == "1" ]]; then
torture_compiler_args=()
has_clang_arg=0
has_gcc_arg=0
for arg in "${torture_args[@]}"; do
case "$arg" in
-clang:*|--clang:*) has_clang_arg=1 ;;
-gcc:*|--gcc:*) has_gcc_arg=1 ;;
esac
done
if [[ "$c" == clang && "$has_clang_arg" == "0" ]]; then
torture_compiler_args=("-clang:$(command -v "${CC:-clang}")")
elif [[ "$c" == gcc && "$has_gcc_arg" == "0" ]]; then
torture_compiler_args=("-gcc:$(command -v "${CC:-gcc}")")
fi
(cd build && ./torture "${torture_compiler_args[@]}" "${torture_args[@]}")
fi
done
done