-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathruntests
More file actions
executable file
·54 lines (44 loc) · 917 Bytes
/
Copy pathruntests
File metadata and controls
executable file
·54 lines (44 loc) · 917 Bytes
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
#!/bin/bash
set -e
function setAll() {
RUN_UNIT=1
RUN_BUILD=1
}
function showHelp() {
echo "Usage: ./runtests [OPTION]..."
echo
echo " -u, --unit unit tests (default)"
echo " -b, --build run build"
echo
echo " --all run all tests and validations"
echo " --help show this help"
}
function showInvalidArg() {
echo "runtests: unrecognized option '$1'"
echo "Try './runtests --help' for more information."
}
if [[ $# -eq 0 ]]; then
RUN_UNIT=1;
fi
while [ $# -gt 0 ]; do
case $1 in
--help) showHelp; break;;
--all) setAll; break;;
-u | --unit) RUN_UNIT=1;;
-l | --lint) RUN_LINT=1;;
-e | --e2e) RUN_E2E=1;;
-b | --build) RUN_BUILD=1;;
*) showInvalidArg "$1"; exit 1;;
esac
shift
done
if [[ -n $RUN_BUILD || -n $RUN_UNIT ]]; then
mkdir build
cd build
cmake ..
make
fi
if [[ -n $RUN_UNIT ]]; then
./test-qsearch
fi
exit 0