-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathMakefile.test
46 lines (33 loc) · 1.98 KB
/
Makefile.test
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
JOBS:=$(shell nproc)
.PHONY: clean build-test build-test-byoc build-test-devmode \
run-tests run-coverage run-tests-with-valgrind \
generate-cli-parsers
clean:
rm -rf build-test config/edge_version_info.h
build:
mkdir -p build-test
generate-cli-parsers:
cd edge-core && ./gen_docopt.sh
lib/mbed-cloud-client/source/update_default_resources.c: lib/mbed-cloud-client
manifest-dev-tool init
build-test-byoc: lib/mbed-cloud-client/source/update_default_resources.c generate-cli-parsers build
mkdir -p build-test
cd build-test && cmake -DBUILD_TARGET=test -DBYOC_MODE=ON -DFOTA_ENABLE=OFF -DFIRMWARE_UPDATE=ON -DTRACE_LEVEL=DEBUG -DCMAKE_BUILD_TYPE=Debug .. && make -j ${JOBS} && cd ..
build-test-fota-byoc: lib/mbed-cloud-client/source/update_default_resources.c generate-cli-parsers build
mkdir -p build-test
cd build-test && cmake -DBUILD_TARGET=test -DBYOC_MODE=ON -DFOTA_ENABLE=ON -DFIRMWARE_UPDATE=ON -DTRACE_LEVEL=DEBUG -DCMAKE_BUILD_TYPE=Debug .. && make -j ${JOBS} && cd ..
build-test-devmode: lib/mbed-cloud-client/source/update_default_resources.c generate-cli-parsers build
mkdir -p build-test-devmode
cd build-test-devmode && cmake -DBUILD_TARGET=test -DDEVELOPER_MODE=ON -DTRACE_LEVEL=DEBUG -DCMAKE_BUILD_TYPE=Debug .. && make -j ${JOBS} && cd ..
run-tests: build-test-byoc
find ./build-test/bin -name "*-test" | xargs -n1 -I{} sh -c '{} || exit 255'
run-tests-fota: build-test-fota-byoc
find ./build-test/bin -name "*-test" | xargs -n1 -I{} sh -c '{} || exit 255'
run-tests-with-valgrind: build-test-byoc
find ./build-test/bin -name "*-test" | xargs -n1 -I{} sh -c 'valgrind --track-origins=yes --num-callers=100 --leak-check=full {}'
run-coverage: run-tests
cd ./build-test && ../test/generate_coverage.sh .. && cd ..
echo "\033[0;33mCoverage report is at ./build-test/coverage.html/index.html\033[0m"
run-fota-coverage: run-tests-fota
cd ./build-test && ../test/generate_coverage.sh .. && cd ..
echo "\033[0;33mCoverage report is at ./build-test/coverage.html/index.html\033[0m"