-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (35 loc) · 944 Bytes
/
Makefile
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
tests: clean_test build_tests
unittest: clean_test run_unittest
benchmark: clean_test run_benchmark
build_tests:
cmake \
-S. \
-Bbuild \
-DCMAKE_BUILD_TYPE=Release \
-DBENCHMARK_ENABLE_TESTING=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DSNAPSHOT_BUILD_TESTS=ON
cmake --build build -j
run_unittest:
./build/bin/unit_test
run_benchmark:
./build/bin/unit_benchmark
clean:
rm -rf ./build
clean_test:
if [ -d ./build/test ]; then \
find ./build/test -name "*.gcda" -print0 | xargs -0 rm -f; \
fi
bazel_ut:
bazel run :unittest --compilation_mode=opt
bazel_bench:
bazel run :benchmark --compilation_mode=opt
bazel_coverage:
bazel coverage --test_output=all :unittest
bazel_coverage_genhtml:
genhtml --output bazel-coverage-html ./bazel-testlogs/unittest/coverage.dat
bazel_clean:
rm -rf bazel-* external
bazel_refresh_all:
bazel run @bazel_compile_commands_extractor//:refresh_all
.PHONY: clean clean_test bazel_clean