-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrun_all_unit_tests.sh
executable file
·90 lines (55 loc) · 1.43 KB
/
run_all_unit_tests.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
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
78
79
80
81
82
83
84
85
86
87
88
89
#! /bin/bash
ScriptPath=$0
Dir=$(cd $(dirname "$ScriptPath"); pwd)
Basename=$(basename "$ScriptPath")
CMakePath=$Dir/_build
# ##########################################################
# command-line handling
while [[ $# -gt 0 ]]; do
case $1 in
--help)
cat << EOF
FastFormat is very fast and very robust C++ formatting library
Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
Copyright (c) 2006-2019, Matthew Wilson and Synesis Software
Runs all (matching) unit-test programs
$ScriptPath [ ... flags/options ... ]
Flags/options:
behaviour:
standard flags:
--help
displays this help and terminates
EOF
exit 0
;;
*)
>&2 echo "$ScriptPath: unrecognised argument '$1'; use --help for usage"
exit 1
;;
esac
shift
done
# ##########################################################
# main()
mkdir -p $CMakePath || exit 1
cd $CMakePath
echo "Executing make and then running all test programs"
status=0
if make; then
for f in $(find $Dir -type f -perm +111 '(' -name 'test*unit*' -o -name 'test*component*' ')')
do
echo
echo "executing $f:"
if $f; then
:
else
status=$?
break 1
fi
done
else
status=$?
fi
cd ->/dev/null
exit $status
# ############################## end of file ############################# #