Improve automated testing rules to allow other test frameworks

- make runtests a double-colon rule, so that other test frameworks
  can add their own recipes independently
- only define runtests:: $TESTSCRIPTS rule when there are TESTSCRIPTS
  (to avoid having it run every time when no TESTSCRIPTS are defined)
- $(strip $TAPFILES) inside ifneq to fix trouble when TAPFILES=' '
This commit is contained in:
Ralph Lange
2020-04-16 12:04:16 +02:00
parent 45cf2ea5ce
commit cbf917e833

View File

@@ -335,10 +335,12 @@ $(MODNAME): %$(MODEXT): %$(EXE)
#---------------------------------------------------------------
# Automated testing
runtests: $(TESTSCRIPTS)
ifneq ($(strip $(TESTSCRIPTS)),)
runtests:: $(TESTSCRIPTS)
ifdef RUNTESTS_ENABLED
-$(PERL) -MTest::Harness -e 'runtests @ARGV if @ARGV;' $^
endif
endif
testspec: $(TESTSCRIPTS)
@$(RM) $@
@@ -349,7 +351,7 @@ testspec: $(TESTSCRIPTS)
$(if $(TESTSPEC_$(OS_CLASS)), @echo "Harness: $(TESTSPEC_$(OS_CLASS))" >> $@)
test-results: tapfiles
ifneq ($(TAPFILES),)
ifneq ($(strip $(TAPFILES)),)
ifdef RUNTESTS_ENABLED
$(PROVE) --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES)
endif