Skip to content

Commit

Permalink
WIP new test list setup (w/o make snippets)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphlange committed Jan 2, 2025
1 parent 58165ba commit 5d19dcb
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions gtestSup/RULES_GTEST
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,24 @@ endif
#---------------------------------------------------------------
# Automated testing using Google Test

GTESTS_MAKE = $(addsuffix .make,$(GTESTS))
GTESTS_RUN = $(addsuffix .run,$(GTESTS))
.PHONY: $(GTESTS_RUN)

runtests: $(GTESTS_RUN)

$(GTESTLISTS): %.list: %$(EXE)
@$(RM) $@
"./$<" --gtest_list_tests > $@

$(GTESTS_MAKE): %.make: %.list
@$(RM) $@
@$(PERL) $(GTEST_BIN)/makeFromList.pl $*
define gtest_run_template
$$($(1)_TAPFILES) $(1)-results.xml: $(1).run
@:
$(1).run: export GTEST_TAP_FILENAME_PREFIX=$(1)-
$(1).run: $(1)$$(EXE)
@$$(ECHO) "Running test $(1)..."
@"./$$<" --gtest_list_tests | $$(PERL) $$(GTEST_BIN)/testSuiteList.pl > $(1).list
@"./$$<" --gtest_output_tap --gtest_color=yes --gtest_output=xml:$(1)-results.xml
@$$(ECHO) "test run" > $(1).run
$(1)_TAPFILES = $(addprefix $(1)-,$(addsuffix .tap,$(file < $(gtest).list)))
endef

include $(GTESTS_MAKE)
$(foreach gtest, $(GTESTS), $(eval $(call gtest_run_template,$(gtest))))

# Can't do "undefine TAPFILES" so only define TAPFILES here if non-empty
# (avoid old test-results rule breaking for TAPFILES = <space>)
Expand Down

0 comments on commit 5d19dcb

Please sign in to comment.