Preliminary main mbed library for nexpaq development

Committer:
nexpaq
Date:
Fri Nov 04 20:27:58 2016 +0000
Revision:
0:6c56fb4bc5f0
Moving to library for sharing updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nexpaq 0:6c56fb4bc5f0 1 #
nexpaq 0:6c56fb4bc5f0 2 # Makefile.test for COAP service unit tests
nexpaq 0:6c56fb4bc5f0 3 #
nexpaq 0:6c56fb4bc5f0 4
nexpaq 0:6c56fb4bc5f0 5 # List of subdirectories to build
nexpaq 0:6c56fb4bc5f0 6 TEST_FOLDER := ./test/
nexpaq 0:6c56fb4bc5f0 7 # List of unit test directories for libraries
nexpaq 0:6c56fb4bc5f0 8 UNITTESTS := $(sort $(dir $(wildcard $(TEST_FOLDER)*/unittest/*)))
nexpaq 0:6c56fb4bc5f0 9 TESTDIRS := $(UNITTESTS:%=build-%)
nexpaq 0:6c56fb4bc5f0 10 CLEANTESTDIRS := $(UNITTESTS:%=clean-%)
nexpaq 0:6c56fb4bc5f0 11 COVERAGEFILE := ./lcov/coverage.info
nexpaq 0:6c56fb4bc5f0 12
nexpaq 0:6c56fb4bc5f0 13 .PHONY: test
nexpaq 0:6c56fb4bc5f0 14 test: $(TESTDIRS)
nexpaq 0:6c56fb4bc5f0 15 @rm -rf ./lcov
nexpaq 0:6c56fb4bc5f0 16 @rm -rf ./coverage
nexpaq 0:6c56fb4bc5f0 17 @mkdir -p lcov
nexpaq 0:6c56fb4bc5f0 18 @mkdir -p lcov/results
nexpaq 0:6c56fb4bc5f0 19 @mkdir coverage
nexpaq 0:6c56fb4bc5f0 20 @find ./test -name '*.xml' | xargs cp -t ./lcov/results/
nexpaq 0:6c56fb4bc5f0 21 @rm -f lcov/index.xml
nexpaq 0:6c56fb4bc5f0 22 @./xsl_script.sh
nexpaq 0:6c56fb4bc5f0 23 @cp junit_xsl.xslt lcov/.
nexpaq 0:6c56fb4bc5f0 24 @xsltproc -o lcov/testresults.html lcov/junit_xsl.xslt lcov/index.xml
nexpaq 0:6c56fb4bc5f0 25 @rm -f lcov/junit_xsl.xslt
nexpaq 0:6c56fb4bc5f0 26 @rm -f lcov/index.xml
nexpaq 0:6c56fb4bc5f0 27 @find ./ -name '*.gcno' | xargs cp --backup=numbered -t ./coverage/
nexpaq 0:6c56fb4bc5f0 28 @find ./ -name '*.gcda' | xargs cp --backup=numbered -t ./coverage/
nexpaq 0:6c56fb4bc5f0 29 @gcovr --object-directory ./coverage --exclude-unreachable-branches -e '.*/builds/.*' -e '.*/test/.*' -e '.*/yotta_modules/.*' -e '.*/stub/.*' -x -o ./lcov/gcovr.xml
nexpaq 0:6c56fb4bc5f0 30 @lcov -d test/. -c -o $(COVERAGEFILE)
nexpaq 0:6c56fb4bc5f0 31 @lcov -q -r $(COVERAGEFILE) "/usr*" -o $(COVERAGEFILE)
nexpaq 0:6c56fb4bc5f0 32 @lcov -q -r $(COVERAGEFILE) "/test*" -o $(COVERAGEFILE)
nexpaq 0:6c56fb4bc5f0 33 @lcov -q -r $(COVERAGEFILE) "/mbed-client-libservice*" -o $(COVERAGEFILE)
nexpaq 0:6c56fb4bc5f0 34 @lcov -q -r $(COVERAGEFILE) "/libService*" -o $(COVERAGEFILE)
nexpaq 0:6c56fb4bc5f0 35 @genhtml -q $(COVERAGEFILE) --show-details --output-directory lcov/html
nexpaq 0:6c56fb4bc5f0 36 @echo coap-service unit tests built
nexpaq 0:6c56fb4bc5f0 37
nexpaq 0:6c56fb4bc5f0 38 $(TESTDIRS):
nexpaq 0:6c56fb4bc5f0 39 @make -C $(@:build-%=%)
nexpaq 0:6c56fb4bc5f0 40
nexpaq 0:6c56fb4bc5f0 41 $(CLEANDIRS):
nexpaq 0:6c56fb4bc5f0 42 @make -C $(@:clean-%=%) clean
nexpaq 0:6c56fb4bc5f0 43
nexpaq 0:6c56fb4bc5f0 44 $(CLEANTESTDIRS):
nexpaq 0:6c56fb4bc5f0 45 @make -C $(@:clean-%=%) clean
nexpaq 0:6c56fb4bc5f0 46
nexpaq 0:6c56fb4bc5f0 47 # Extend default clean rule
nexpaq 0:6c56fb4bc5f0 48 clean: clean-extra
nexpaq 0:6c56fb4bc5f0 49
nexpaq 0:6c56fb4bc5f0 50 clean-extra: $(CLEANDIRS) \
nexpaq 0:6c56fb4bc5f0 51 $(CLEANTESTDIRS)