forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all.sh
More file actions
74 lines (57 loc) · 1.02 KB
/
run_all.sh
File metadata and controls
74 lines (57 loc) · 1.02 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
#!/bin/sh
@INCLUDE_COMMON@
echo
echo RUN ALL TESTS
echo
check_version
echo
cd "@CMAKE_INSTALL_PREFIX@/@TARGET_TOOL_EXEC_FOLDER@" || exit
nbTests="0"
nbFailed=""
cleanup() {
rm -rf "$EXPORT_DIR"
}
EXPORT_DIR="$(mktempdir_elektra)"
export_config "$EXPORT_DIR"
# Parse optional argument `-v`
OPTIND=1
while getopts "v" option; do
case "$option" in
v)
verbose=0
;;
esac
done
shift "$((OPTIND - 1))"
for t in test* check*; do
if [ "$t" = "testmod_zeromqsend" ]; then
echo
printf "Skipping $t, see 'doc/todo/TESTING'\n"
echo
continue
fi
echo "Running $t"
OUTPUT="$("$KDB" "$t" 2>&1)"
status=$?
if [ $status != 0 ] || [ $verbose ]; then
echo
printf '%s' "$OUTPUT"
echo
fi
if [ $status != "0" ]; then
nbError=$((nbError + 1))
nbFailed="$nbFailed\n$t"
echo error: "$t"
echo
fi
nbTests=$((nbTests + 1))
export_check "$EXPORT_DIR" "$t"
done
if [ $nbError != "0" ]; then
echo
printf "Following test cases failed: $nbFailed\n"
echo
fi
# fake the number of tests:
nbTest=$nbTests
end_script all