-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathlibSetReplaceTest.sh
More file actions
executable file
·40 lines (35 loc) · 964 Bytes
/
libSetReplaceTest.sh
File metadata and controls
executable file
·40 lines (35 loc) · 964 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
#!/usr/bin/env bash
set -eo pipefail
if [ "$(uname)" = "Darwin" ]; then
testBinaries=$(find build/libSetReplace/test -type f -perm +111 -print)
elif [ "$(uname)" = "Linux" ]; then
testBinaries=$(find build/libSetReplace/test -type f -executable -print)
else
echo "Operating System not supported."
exit 1
fi
if [ -z "$testBinaries" ]; then
echo "No tests found."
echo "Build libSetReplace tests first:"
echo " mkdir build && cd build"
echo " cmake .. -DSET_REPLACE_BUILD_TESTING=ON"
echo " cmake --build ."
echo " cd .."
exit 1
fi
libSetReplaceTestsDir=TestResults/libSetReplace
mkdir -p TestResults
exitStatus=0
isFirstTest=1
for testBinary in $testBinaries; do
if [ $isFirstTest -eq 0 ]; then
echo
fi
isFirstTest=0
testBasename=$(basename "$testBinary")
echo "$testBasename..."
if ! eval "$testBinary" --gtest_output=xml:"$libSetReplaceTestsDir"/"$testBasename".xml; then
exitStatus=1
fi
done
exit $exitStatus