Generate JUnit style report for kernel unit test (#504)

* Add JUnit test report to ut
* Add JUnit test report with make run
* Fix gcc path
pull/503/head^2
alfred gedeon 4 years ago committed by GitHub
parent 63aec3607d
commit c4d8002634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,7 +14,7 @@ execs: $(UNITS) | directories
$(UNITS) : ${LIB_DIR}/libcmock.so ${LIB_DIR}/libunity.so | directories
$(MAKE) -C $@
$(MAKE) -C $@
doc: | directories
$(MAKE) -C doc all
@ -50,21 +50,24 @@ $(LIB_DIR)/libcmock.so : ${CMOCK_SRC_DIR}/cmock.c \
$(LIB_DIR)/libunity.so : ${UNITY_SRC_DIR}/unity.c \
${UNITY_SRC_DIR}/unity.h \
Makefile | directories
${CC} -o $@ -shared -fPIC $<
${CC} -o $@ -shared -fPIC $<
run : $(UNITS) zero_coverage | directories
for f in $(BIN_DIR)/*; do \
$${f}; done
run : $(UNITS) directories
-rm $(BUILD_DIR)/unit_test_report.txt
for f in $(BIN_DIR)/*; do \
$${f} | tee -a $(BUILD_DIR)/unit_test_report.txt ; done
cd $(BUILD_DIR) && \
ruby $(UNITY_BIN_DIR)/parse_output.rb -xml $(BUILD_DIR)/unit_test_report.txt
run_col : $(UNITS) zero_coverage | directories
for f in $(BIN_DIR)/*; do \
ruby -r $(UNITY_BIN_DIR)/colour_reporter.rb -e "report('`$${f}`')"; done
ruby -r $(UNITY_BIN_DIR)/colour_reporter.rb -e "report('`$${f}`')"; done
run_formatted : $(UNITS) zero_coverage | directories
for f in $(BIN_DIR)/*; do \
$${f} > $(BUILD_DIR)/output; \
ruby $(UNITY_BIN_DIR)/parse_output.rb $(BUILD_DIR)/output ; \
done
done
run_col_formatted : $(UNITS) zero_coverage | directories
for f in $(BIN_DIR)/*; do \
@ -72,7 +75,7 @@ run_col_formatted : $(UNITS) zero_coverage | directories
ruby -r $(UNITY_BIN_DIR)/colour_reporter.rb \
-e "report('$$(ruby $(UNITY_BIN_DIR)/parse_output.rb \
$(BUILD_DIR)/output)')"; \
done
done
zero_coverage :
lcov --zerocounters --directory $(BUILD_DIR)
@ -82,3 +85,4 @@ coverage : run_col
genhtml $(BUILD_DIR)/cmock_test.info --branch-coverage \
--output-directory $(COVERAGE_DIR)

Loading…
Cancel
Save