Files
bacnet_stack/test/Makefile
T
Steve Karg c3a4c229fe Issue 87 execute tests with GitHub ci (#234)
* Enable lcov coverage in unit testing via cmake.

* fix pipeline build error

* add compile options for unit test to silence some warnings

* remove all BAC_TEST unit tests in src/bacnet/ folder. They are now in test/bacnet/ folders using ztest.

* removed key.c - only used for unit test.

* produce XML test result output for parsing

* produce junit XML test result output

* change lint workflow to quality

* update readme badge for quality results

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-02-28 20:09:46 -06:00

32 lines
886 B
Makefile

# Main Makefile for BACnet-stack applications, tests, and sample ports
# Export the variables defined here to all subprocesses
# (see http://www.gnu.org/software/automake/manual/make/Special-Targets.html)
.EXPORT_ALL_VARIABLES:
# all: demos router-ipv6 ${DEMO_LINUX}
.PHONY: all
all: test
BUILD_DIR=build
CTEST_OPTIONS := --quiet --output-on-failure --parallel 4
CTEST_OPTIONS += --output-junit test-results.xml
.PHONY: test
test:
[ -d $(BUILD_DIR) ] || mkdir -p $(BUILD_DIR)
[ -d $(BUILD_DIR) ] && cd $(BUILD_DIR) && cmake .. && cd ..
[ -d $(BUILD_DIR) ] && cd $(BUILD_DIR) && cmake --build . --clean-first && cd ..
[ -d $(BUILD_DIR) ] && cd $(BUILD_DIR) && ctest $(CTEST_OPTIONS)
[ -d $(BUILD_DIR) ] && $(MAKE) -C $(BUILD_DIR) lcov
.PHONY: report
report:
[ -d $(BUILD_DIR) ] && cat $(BUILD_DIR)/Testing/Temporary/LastTest*.log
.PHONY: clean
clean:
-rm -rf $(BUILD_DIR)