This repository was archived by the owner on Aug 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-26
lines changed Expand file tree Collapse file tree 1 file changed +13
-26
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# Based on https://github.com/codecov/example-cpp11-cmake/blob/master/run_build.sh.
4
4
5
+ set -e
6
+
5
7
RED=' \033[0;31m'
6
8
BLUE=' \033[0;34m'
7
9
NO_COLOR=' \033[0m'
8
10
GREEN=' \033[0;32m'
9
11
10
- function error() {
11
- >&2 echo -e " ${RED} $1 ${NO_COLOR} "
12
- }
13
-
14
12
function info() {
15
13
echo -e " ${GREEN} $1 ${NO_COLOR} "
16
14
}
@@ -19,26 +17,15 @@ function working() {
19
17
echo -e " ${BLUE} $1 ${NO_COLOR} "
20
18
}
21
19
22
- mkdir -p build
23
- cd build || exit
24
- if [ " x$COVERAGE " != " x" ]; then
25
- cmake -DCMAKE_BUILD_TYPE=Debug -DJAEGERTRACING_COVERAGE=ON ..
26
- else
27
- cmake -DCMAKE_BUILD_TYPE=Debug -DJAEGERTRACING_COVERAGE=OFF ..
28
- fi
29
-
30
- if make -j3 UnitTest; then
31
- true
32
- else
33
- error " Error: compilation errors"
34
- exit 3
35
- fi
36
-
37
- info " Running tests..."
38
- if ./UnitTest; then
39
- true
40
- else
41
- error " Error: test failure"
42
- fi
20
+ function main() {
21
+ mkdir -p build
22
+ cd build
23
+ coverage_option=${COVERAGE: +" -DJAEGERTRACING_COVERAGE=ON" }
24
+ cmake -DCMAKE_BUILD_TYPE=Debug " ${coverage_option} " ..
25
+ make -j3 UnitTest
26
+ info " Running tests..."
27
+ ./UnitTest
28
+ working " All tests compiled and passed"
29
+ }
43
30
44
- working " All tests compiled and passed "
31
+ main
You can’t perform that action at this time.
0 commit comments