From cbf917e8332d620b6a2f60ea9822d1f84467ef28 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 16 Apr 2020 12:04:16 +0200 Subject: [PATCH 01/21] 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=' ' --- configure/RULES_BUILD | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index ca05f19c6..8bc94ba33 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -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 From fde0485d6b23709c99b65cbaad963b6cdd6e3414 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 16 Apr 2020 17:10:53 -0500 Subject: [PATCH 02/21] Added Mark Rivers' tests for the message queue timeout bug --- src/libCom/test/epicsMessageQueueTest.cpp | 49 ++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/src/libCom/test/epicsMessageQueueTest.cpp b/src/libCom/test/epicsMessageQueueTest.cpp index ae090fc47..5e803ea15 100644 --- a/src/libCom/test/epicsMessageQueueTest.cpp +++ b/src/libCom/test/epicsMessageQueueTest.cpp @@ -27,6 +27,7 @@ static volatile int sendExit = 0; static volatile int recvExit = 0; static epicsEventId finished; static unsigned int mediumStack; +static int numReceived; /* * In Numerical Recipes in C: The Art of Scientific Computing (William H. @@ -115,6 +116,21 @@ receiver(void *arg) epicsEventSignal(finished); } +extern "C" void +fastReceiver(void *arg) +{ + epicsMessageQueue *q = (epicsMessageQueue *)arg; + char cbuf[80]; + int len; + numReceived = 0; + while (!recvExit) { + len = q->receive(cbuf, sizeof cbuf, 0.01); + if (len > 0) { + numReceived++; + } + } +} + extern "C" void sender(void *arg) { @@ -140,8 +156,10 @@ extern "C" void messageQueueTest(void *parm) int len; int pass; int want; + int numSent = 0; epicsMessageQueue *q1 = new epicsMessageQueue(4, 20); + epicsMessageQueue *q2 = new epicsMessageQueue(4, 20); testDiag("Simple single-thread tests:"); i = 0; @@ -251,6 +269,35 @@ extern "C" void messageQueueTest(void *parm) testOk(q1->send((void *)msg1, 10) == 0, "Send with no receiver"); epicsThreadSleep(2.0); + testDiag("Single receiver with timeout, single sender with sleep tests:"); + testDiag("These tests last 20 seconds ..."); + epicsThreadCreate("Fast Receiver", epicsThreadPriorityMedium, + mediumStack, fastReceiver, q2); + numSent = 0; + numReceived = 0; + for (i = 0 ; i < 1000 ; i++) { + if (q2->send((void *)msg1, 4) == 0) { + numSent++; + } + epicsThreadSleep(0.011); + } + epicsThreadSleep(1.0); + if (!testOk(numSent == 1000 && numReceived == 1000, "sleep=0.011")) { + testDiag("numSent should be 1000, actual=%d, numReceived should be 1000, actual=%d", numSent, numReceived); + } + numSent = 0; + numReceived = 0; + for (i = 0 ; i < 1000 ; i++) { + if (q2->send((void *)msg1, 4) == 0) { + numSent++; + } + epicsThreadSleep(0.010); + } + epicsThreadSleep(1.0); + if (!testOk(numSent == 1000 && numReceived == 1000, "sleep=0.010")) { + testDiag("numSent should be 1000, actual=%d, numReceived should be 1000, actual=%d", numSent, numReceived); + } + testDiag("Single receiver, single sender tests:"); epicsThreadSetPriority(myThreadId, epicsThreadPriorityHigh); epicsThreadCreate("Receiver one", epicsThreadPriorityMedium, @@ -312,7 +359,7 @@ extern "C" void messageQueueTest(void *parm) MAIN(epicsMessageQueueTest) { - testPlan(62); + testPlan(64); finished = epicsEventMustCreate(epicsEventEmpty); mediumStack = epicsThreadGetStackSize(epicsThreadStackMedium); From a9727fd5cbd6c27d4ecf6a61e6984537c3cbc5fe Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 16 Apr 2020 17:12:25 -0500 Subject: [PATCH 03/21] Ben Franksen's fix for lp: #1868486 --- src/libCom/osi/os/default/osdMessageQueue.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libCom/osi/os/default/osdMessageQueue.cpp b/src/libCom/osi/os/default/osdMessageQueue.cpp index fabfa1b85..fc50a36b7 100644 --- a/src/libCom/osi/os/default/osdMessageQueue.cpp +++ b/src/libCom/osi/os/default/osdMessageQueue.cpp @@ -5,7 +5,7 @@ * Operator of Los Alamos National Laboratory. * EPICS BASE Versions 3.13.7 * and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* in file LICENSE that is included with this distribution. \*************************************************************************/ /* * Author W. Eric Norum @@ -50,7 +50,7 @@ struct epicsMessageQueueOSD { ELLLIST receiveQueue; ELLLIST eventFreeList; int numberOfSendersWaiting; - + epicsMutexId mutex; unsigned long capacity; unsigned long maxMessageSize; @@ -335,11 +335,10 @@ myReceive(epicsMessageQueueId pmsg, void *message, unsigned int size, ellAdd(&pmsg->receiveQueue, &threadNode.link); epicsMutexUnlock(pmsg->mutex); - epicsEventStatus status; if (timeout > 0) - status = epicsEventWaitWithTimeout(threadNode.evp->event, timeout); + epicsEventWaitWithTimeout(threadNode.evp->event, timeout); else - status = epicsEventWait(threadNode.evp->event); + epicsEventWait(threadNode.evp->event); epicsMutexMustLock(pmsg->mutex); @@ -349,8 +348,7 @@ myReceive(epicsMessageQueueId pmsg, void *message, unsigned int size, epicsMutexUnlock(pmsg->mutex); - if (threadNode.eventSent && (threadNode.size <= size) && - status == epicsEventOK) + if (threadNode.eventSent && (threadNode.size <= size)) return threadNode.size; return -1; } From 841effe9eebf8e572ebe910e6ec6999a9379739c Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 16 Apr 2020 17:14:58 -0500 Subject: [PATCH 04/21] epicsMessageQueueTest: Shorten the 1R4S tests --- src/libCom/test/epicsMessageQueueTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libCom/test/epicsMessageQueueTest.cpp b/src/libCom/test/epicsMessageQueueTest.cpp index 5e803ea15..1bee13c36 100644 --- a/src/libCom/test/epicsMessageQueueTest.cpp +++ b/src/libCom/test/epicsMessageQueueTest.cpp @@ -332,7 +332,7 @@ extern "C" void messageQueueTest(void *parm) * Single receiver, multiple sender tests */ testDiag("Single receiver, multiple sender tests:"); - testDiag("This test lasts 60 seconds..."); + testDiag("This test lasts 30 seconds..."); testOk(!!epicsThreadCreate("Sender 1", epicsThreadPriorityLow, mediumStack, sender, q1), "Created Sender 1"); @@ -346,9 +346,9 @@ extern "C" void messageQueueTest(void *parm) mediumStack, sender, q1), "Created Sender 4"); - for (i = 0; i < 10; i++) { - testDiag("... %2d", 10 - i); - epicsThreadSleep(6.0); + for (i = 0; i < 6; i++) { + testDiag("... %2d", 6 - i); + epicsThreadSleep(5.0); } sendExit = 1; From 648589e6ab234cf95e5cf394bbee6ec4442959e9 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 17 Apr 2020 16:42:18 -0500 Subject: [PATCH 05/21] podToHtml: Add bootstrap search path for EPICS::PodHtml --- src/tools/podToHtml.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/podToHtml.pl b/src/tools/podToHtml.pl index 21bf3a161..f661ad3f4 100644 --- a/src/tools/podToHtml.pl +++ b/src/tools/podToHtml.pl @@ -9,8 +9,12 @@ use strict; use warnings; +# To find the EPICS::PodHtml module used below we need to add our lib/perl to +# the lib search path. If the script is running from the src/tools directory +# before everything has been installed though, the search path must include +# our source directory (i.e. $Bin), so we add both here. use FindBin qw($Bin); -use lib "$Bin/../../lib/perl"; +use lib ("$Bin/../../lib/perl", $Bin); use Getopt::Std; use EPICS::PodHtml; From 566ab038d29447c2c6c33e94b493207eb9b0ffa1 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 17 Apr 2020 16:51:48 -0500 Subject: [PATCH 06/21] Make test-results not fail so it shows all results For some reason 'make -k test-results' isn't always doing the -k (continue-on-error) on Windows. --- configure/RULES_BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 8bc94ba33..6145927d2 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -353,7 +353,7 @@ testspec: $(TESTSCRIPTS) test-results: tapfiles ifneq ($(strip $(TAPFILES)),) ifdef RUNTESTS_ENABLED - $(PROVE) --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES) + -$(PROVE) --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES) endif CURRENT_TAPFILES := $(wildcard $(TAPFILES)) From 3790ce4452e145d491604724698db2e4ba212358 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 18 Apr 2020 00:18:11 -0500 Subject: [PATCH 07/21] Have 'make test-results' fail nicely if any tests did Lists the directories with failed tests at the end of the build. It is no longer necessary to use 'make -k' to see the results of all tests after one or more failures as only the top-level test-results recipe will generate a build error. --- .gitignore | 1 + configure/CONFIG_BASE | 11 +++++++++-- configure/RULES_BUILD | 2 +- configure/RULES_DIRS | 9 +++++---- configure/RULES_TOP | 5 +++++ src/tools/Makefile | 1 + src/tools/testFailures.pl | 31 +++++++++++++++++++++++++++++++ 7 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 src/tools/testFailures.pl diff --git a/.gitignore b/.gitignore index 2dd7304c2..27871fffe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /include/ /templates/ /configure/*.local +/.tests-failed O.*/ /QtC-* *.orig diff --git a/configure/CONFIG_BASE b/configure/CONFIG_BASE index c979d6d7c..54747d8e3 100644 --- a/configure/CONFIG_BASE +++ b/configure/CONFIG_BASE @@ -68,8 +68,6 @@ DBTOMENUH = $(PERL) $(TOOLS)/dbdToMenuH.pl REGISTERRECORDDEVICEDRIVER = $(PERL) $(TOOLS)/registerRecordDeviceDriver.pl CONVERTRELEASE = $(PERL) $(call FIND_TOOL,convertRelease.pl) FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl -TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl -PROVE = $(PERL) $(TOOLS)/epicsProve.pl #------------------------------------------------------- # tools for installing libraries and products @@ -83,6 +81,15 @@ INSTALL_LIBRARY = $(INSTALL) MKMF = $(PERL) $(TOOLS)/mkmf.pl REPLACEVAR = $(PERL) $(TOOLS)/replaceVAR.pl +#--------------------------------------------------------------- +# Tools for testing +TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl +PROVE = $(PERL) $(TOOLS)/epicsProve.pl +PROVE.tap = $(PROVE) --ext .tap --exec "$(CAT)" + +TEST_FAILURE_FILE = $(TOP)/.tests-failed +PROVE_FAILURE = echo $(abspath .)>> $(TEST_FAILURE_FILE) + #--------------------------------------------------------------- # private versions of lex/yacc from EPICS EYACC = $(TOOLS)/antelope$(HOSTEXE) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 6145927d2..beace64c6 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -353,7 +353,7 @@ testspec: $(TESTSCRIPTS) test-results: tapfiles ifneq ($(strip $(TAPFILES)),) ifdef RUNTESTS_ENABLED - -$(PROVE) --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES) + -$(PROVE.tap) --failures --color $(TAPFILES) || $(PROVE_FAILURE) endif CURRENT_TAPFILES := $(wildcard $(TAPFILES)) diff --git a/configure/RULES_DIRS b/configure/RULES_DIRS index 37cea5e9a..e90006890 100644 --- a/configure/RULES_DIRS +++ b/configure/RULES_DIRS @@ -4,7 +4,7 @@ # Copyright (c) 2002 The Regents of the University of California, as # Operator of Los Alamos National Laboratory. # EPICS BASE is distributed subject to a Software License Agreement found -# in the file LICENSE that is included with this distribution. +# in the file LICENSE that is included with this distribution. #************************************************************************* ARCHS += $(BUILD_ARCHS) @@ -79,14 +79,15 @@ $(foreach arch, $(ARCHS), \ dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@)))) actionArchPart = $(join $(word 2, $(subst $(DIVIDER), ,$(notdir $@))), \ - $(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$(notdir $@))))) -$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets) : + $(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$(notdir $@))))) + +$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets): pre-make $(MAKE) -C $(dirPart) $(actionArchPart) $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \ $(foreach dir, $(DIRS), $(dir)$(DIVIDER)%) -.PHONY : $(DIRS) all host rebuild +.PHONY : $(DIRS) all host rebuild pre-make .PHONY : $(ARCHS) $(ACTIONS) .PHONY : $(dirActionTargets) $(dirArchTargets) .PHONY : $(dirActionArchTargets) diff --git a/configure/RULES_TOP b/configure/RULES_TOP index 176454187..627f4b63c 100644 --- a/configure/RULES_TOP +++ b/configure/RULES_TOP @@ -35,6 +35,11 @@ uninstall$(DIVIDER)%: $(RMDIR) $(addsuffix /$(subst uninstall$(DIVIDER),,$@), \ $(INSTALL_LOCATION_BIN) $(INSTALL_LOCATION_LIB)) +pre-make: + @$(if $(filter test-results, $(MAKECMDGOALS)), \ + $(RM) $(TEST_FAILURE_FILE)) +test-results: + $(PERL) $(TOOLS)/testFailures.pl $(TEST_FAILURE_FILE) help: @echo "Usage: gnumake [options] [target] ..." diff --git a/src/tools/Makefile b/src/tools/Makefile index 26c0ed99a..faa08abbf 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -52,6 +52,7 @@ PERL_SCRIPTS += mkmf.pl PERL_SCRIPTS += munch.pl PERL_SCRIPTS += replaceVAR.pl PERL_SCRIPTS += tap-to-junit-xml.pl +PERL_SCRIPTS += testFailures.pl PERL_SCRIPTS += useManifestTool.pl PERL_SCRIPTS += dbdToMenuH.pl diff --git a/src/tools/testFailures.pl b/src/tools/testFailures.pl new file mode 100644 index 000000000..e74dd269f --- /dev/null +++ b/src/tools/testFailures.pl @@ -0,0 +1,31 @@ +#!/usr/bin/env perl +#************************************************************************* +# EPICS BASE is distributed subject to a Software License Agreement found +# in the file LICENSE that is included with this distribution. +#************************************************************************* + +# This file may appear trivial, but it exists to let the build system +# fail the 'make test-results' target with a nice output including a +# summary of the directories where test failures were reported. +# Test results are collected from the .tap files fed to epicsProve.pl +# which returns with an exit status of 0 (success) if all tests passed +# or 1 (failure) if any of the .tap files contained failed tests. +# When epicsProve.pl indicates a failure, the directory that it was +# running in is appended to the file $(TOP)/.tests-failed which this +# program reads in after all the test directories have been visited. +# The exit status of this program is 1 (failure) if any tests failed, +# otherwise 0 (success). + +use strict; +use warnings; + +die "Usage: testFailures.pl .tests-failed\n" + unless @ARGV == 1; + +open FAILURES, '<', shift or + exit 0; + +print "\nTest failures were reported in:\n", + map {" $_\n"} ; + +exit 1; From 91c18c32d461dfe1edb3672e7e5afee01de89a2f Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 18 Apr 2020 00:36:35 -0500 Subject: [PATCH 08/21] Have Appveyor make 'tapfiles test-results' instead of 'runtests' --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index bc04839e5..a76d7c525 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,7 +77,7 @@ build_script: - cmd: ci/appveyor-make.bat test_script: - - cmd: ci/appveyor-make.bat runtests + - cmd: ci/appveyor-make.bat tapfiles test-results #---------------------------------# # notifications # From be061e108493818cb9265465ce115153cd031d20 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 20 Apr 2020 11:31:33 -0500 Subject: [PATCH 09/21] Tidy up testFailures script slighlty --- src/tools/testFailures.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/testFailures.pl b/src/tools/testFailures.pl index e74dd269f..e19d00006 100644 --- a/src/tools/testFailures.pl +++ b/src/tools/testFailures.pl @@ -24,8 +24,10 @@ die "Usage: testFailures.pl .tests-failed\n" open FAILURES, '<', shift or exit 0; +my @failures = ; +close FAILURES; print "\nTest failures were reported in:\n", - map {" $_\n"} ; + (map {" $_"} @failures), "\n"; exit 1; From b6556621314d8fca6fcfdbb911cc14a324f315ee Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 20 Apr 2020 11:33:37 -0500 Subject: [PATCH 10/21] Appveyor: Move 'make test-results' to the on_finish stage --- appveyor.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index a76d7c525..891a4b8b2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,7 +77,10 @@ build_script: - cmd: ci/appveyor-make.bat test_script: - - cmd: ci/appveyor-make.bat tapfiles test-results + - cmd: ci/appveyor-make.bat tapfiles + +on_finish: + - cmd: ci/appveyor-make.bat -s test-results #---------------------------------# # notifications # From 582a9dbef58903be3c8c3e168b1e8b1f5d573563 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 21 Apr 2020 01:14:03 -0500 Subject: [PATCH 11/21] Replace pre-make rule with before-actions rules For all standard build ACTIONS, a rule before- is run just before running that action in the subdirectories given by the DIRS variable. Only works in Makefiles that include RULES_DIRS or RULES_TOP. --- configure/RULES_DIRS | 14 ++++++++++---- configure/RULES_TOP | 10 +++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/configure/RULES_DIRS b/configure/RULES_DIRS index e90006890..92d2035dc 100644 --- a/configure/RULES_DIRS +++ b/configure/RULES_DIRS @@ -54,7 +54,7 @@ $(foreach dir, $(DIRS), \ define DEP_template2 $(1)$$(DIVIDER)$(2) : $$(foreach ddir, $$($(1)_DEPEND_DIRS), \ - $$(addsuffix $$(DIVIDER)$(2),$$(ddir))) + $$(addsuffix $$(DIVIDER)$(2),$$(ddir))) | before-$(2) endef $(foreach action, $(ACTIONS), \ $(foreach dir, $(DIRS), \ @@ -81,14 +81,20 @@ dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@)))) actionArchPart = $(join $(word 2, $(subst $(DIVIDER), ,$(notdir $@))), \ $(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$(notdir $@))))) -$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets): pre-make +$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets): $(MAKE) -C $(dirPart) $(actionArchPart) +# before-action rules are run once prior to recursing through the +# list of subdirectories and running the action rule in each one. +# See DEP_template2 above for how that rule ordering is achieved. +beforeActions = $(addprefix before-,$(ACTIONS)) +$(beforeActions): + $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \ $(foreach dir, $(DIRS), $(dir)$(DIVIDER)%) -.PHONY : $(DIRS) all host rebuild pre-make -.PHONY : $(ARCHS) $(ACTIONS) +.PHONY : $(DIRS) all host rebuild +.PHONY : $(ARCHS) $(ACTIONS) $(beforeActions) .PHONY : $(dirActionTargets) $(dirArchTargets) .PHONY : $(dirActionArchTargets) .PHONY : $(actionArchTargets) diff --git a/configure/RULES_TOP b/configure/RULES_TOP index 627f4b63c..d77e2a6c3 100644 --- a/configure/RULES_TOP +++ b/configure/RULES_TOP @@ -35,10 +35,10 @@ uninstall$(DIVIDER)%: $(RMDIR) $(addsuffix /$(subst uninstall$(DIVIDER),,$@), \ $(INSTALL_LOCATION_BIN) $(INSTALL_LOCATION_LIB)) -pre-make: - @$(if $(filter test-results, $(MAKECMDGOALS)), \ - $(RM) $(TEST_FAILURE_FILE)) -test-results: +before-runtests before-test-results: rm-failure-file +rm-failure-file: + @$(RM) $(TEST_FAILURE_FILE) +runtests test-results: $(PERL) $(TOOLS)/testFailures.pl $(TEST_FAILURE_FILE) help: @@ -74,7 +74,7 @@ help: @echo " xxxRecord.o" .PHONY: distclean cvsclean realuninstall archuninstall uninstallDirs -.PHONY: uninstall help +.PHONY: uninstall rm-failure-file help # Include /cfg/TOP_RULES* files from tops defined in RELEASE* files # From d05d8807ec7d72558d9f34712f9734e5e048458a Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 21 Apr 2020 01:17:48 -0500 Subject: [PATCH 12/21] Stop generating the testspec file It was created before modern continuous integration systems came along; Diamond were supposed to run the tests for us, but they didn't last for very long. --- configure/RULES_BUILD | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index beace64c6..fbac3f765 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -105,11 +105,8 @@ PRODTARGETS += $(PRODNAME) $(MUNCHNAME) $(CTDT_SRCS) $(CTDT_OBJS) $(NMS) TESTPRODTARGETS += $(TESTPRODNAME) $(TESTMUNCHNAME) #--------------------------------------------------------------- -# Test specifications and test result files +# Test result files # -ifneq (,$(strip $(TESTS))) -TARGETS += testspec -endif # Enable testing if this host can run tests on the current target ifneq (,$(findstring $(T_A),$(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS))) @@ -342,14 +339,6 @@ ifdef RUNTESTS_ENABLED endif endif -testspec: $(TESTSCRIPTS) - @$(RM) $@ - @echo OS-class: $(OS_CLASS) > $@ - @echo Target-arch: $(T_A) >> $@ - $(if $^, @echo Tests: $^ >> $@) - $(if $(TESTFILES), @echo Files: $(TESTFILES) >> $@) - $(if $(TESTSPEC_$(OS_CLASS)), @echo "Harness: $(TESTSPEC_$(OS_CLASS))" >> $@) - test-results: tapfiles ifneq ($(strip $(TAPFILES)),) ifdef RUNTESTS_ENABLED From dfbda1394d675213d1e10dc0e1e7df67b923675d Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 21 Apr 2020 01:39:59 -0500 Subject: [PATCH 13/21] Revert the runtests:: change but in an extensible way Use only %.t files in new TESTSCRIPTS.t var for Perl tests. TAPFILES and JUNITFILES can be appended to by other rules. The runtests and test-results rules have no direct recipes. Added run-tap-tests and tap-results rules, simlified recipe. Make %.tap:%.t and %.xml:%.tap into static pattern rules. --- configure/RULES_BUILD | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index fbac3f765..28ece67e1 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -108,11 +108,12 @@ TESTPRODTARGETS += $(TESTPRODNAME) $(TESTMUNCHNAME) # Test result files # -# Enable testing if this host can run tests on the current target -ifneq (,$(findstring $(T_A),$(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS))) +# Enable testing if this host can run tests for the current target +ifneq (,$(filter $(T_A), $(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS))) RUNTESTS_ENABLED = YES -TAPFILES += $(TESTSCRIPTS:.t=.tap) -JUNITFILES += $(TAPFILES:.tap=.xml) +TESTSCRIPTS.t = $(filter %.t, $(TESTSCRIPTS)) +TAPFILES += $(TESTSCRIPTS.t:.t=.tap) +JUNITFILES += $(TESTSCRIPTS.t:.t=.xml) endif #--------------------------------------------------------------- @@ -332,17 +333,22 @@ $(MODNAME): %$(MODEXT): %$(EXE) #--------------------------------------------------------------- # Automated testing -ifneq ($(strip $(TESTSCRIPTS)),) -runtests:: $(TESTSCRIPTS) +runtests: run-tap-tests +run-tap-tests: $(TESTSCRIPTS.t) +ifneq ($(TESTSCRIPTS.t),) ifdef RUNTESTS_ENABLED - -$(PERL) -MTest::Harness -e 'runtests @ARGV if @ARGV;' $^ + $(PROVE) --failures --color $^ || $(PROVE_FAILURE) endif endif -test-results: tapfiles +tapfiles: $(TAPFILES) +junitfiles: $(JUNITFILES) + +test-results: tap-results +tap-results: $(TAPFILES) ifneq ($(strip $(TAPFILES)),) ifdef RUNTESTS_ENABLED - -$(PROVE.tap) --failures --color $(TAPFILES) || $(PROVE_FAILURE) + $(PROVE.tap) --failures --color $^ || $(PROVE_FAILURE) endif CURRENT_TAPFILES := $(wildcard $(TAPFILES)) @@ -357,16 +363,13 @@ ifneq ($(CURRENT_JUNITFILES),) $(RM) $(CURRENT_JUNITFILES) endif -tapfiles: $(TESTSCRIPTS) $(TAPFILES) -junitfiles: $(JUNITFILES) - # A .tap file is the output from running the associated test script -%.tap: %.t +$(TAPFILES): %.tap: %.t ifdef RUNTESTS_ENABLED -$(PERL) $< -tap > $@ endif -%.xml: %.tap +$(JUNITFILES): %.xml: %.tap $(TAPTOJUNIT) --puretap --output $@ --input $< $* # If there's a perl test script (.plt) available, use it @@ -513,8 +516,8 @@ $(INSTALL_TEMPLATES_SUBDIR)/%: % .PRECIOUS: $(COMMON_INC) .PHONY: all host inc build install clean rebuild buildInstall build_clean -.PHONY: runtests tapfiles clean-tests test-results junitfiles -.PHONY: checkRelease warnRelease noCheckRelease +.PHONY: runtests run-tap-tests tapfiles junitfiles test-results tap-results +.PHONY: clean-tests checkRelease warnRelease noCheckRelease endif # BASE_RULES_BUILD # EOF RULES_BUILD From f10d0d95b0618716c03ce9544962a960b4f1a09b Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Tue, 21 Apr 2020 11:45:50 +0200 Subject: [PATCH 14/21] Apply perl rules for .tap and .xml only to perl tests Don't apply the %.tap: %.t and %.xml: %.tap rules to tap and junit result files from other test frameworks. (They would overwrite the other frameworks' own rules.) --- configure/RULES_BUILD | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 28ece67e1..c7f3ba7b6 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -112,8 +112,10 @@ TESTPRODTARGETS += $(TESTPRODNAME) $(TESTMUNCHNAME) ifneq (,$(filter $(T_A), $(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS))) RUNTESTS_ENABLED = YES TESTSCRIPTS.t = $(filter %.t, $(TESTSCRIPTS)) -TAPFILES += $(TESTSCRIPTS.t:.t=.tap) -JUNITFILES += $(TESTSCRIPTS.t:.t=.xml) +TAPFILES.t += $(TESTSCRIPTS.t:.t=.tap) +JUNITFILES.t += $(TESTSCRIPTS.t:.t=.xml) +TAPFILES += $(TAPFILES.t) +JUNITFILES += $(JUNITFILES.t) endif #--------------------------------------------------------------- @@ -364,12 +366,12 @@ ifneq ($(CURRENT_JUNITFILES),) endif # A .tap file is the output from running the associated test script -$(TAPFILES): %.tap: %.t +$(TAPFILES.t): %.tap: %.t ifdef RUNTESTS_ENABLED -$(PERL) $< -tap > $@ endif -$(JUNITFILES): %.xml: %.tap +$(JUNITFILES.t): %.xml: %.tap $(TAPTOJUNIT) --puretap --output $@ --input $< $* # If there's a perl test script (.plt) available, use it From 1ff64f72a9cb9d94bb88bc912973bdcbc062ec0b Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 23 Apr 2020 16:00:13 +0200 Subject: [PATCH 15/21] ci: move ci -> .ci-local also rename appveyor.yml -> .appveyor.yml --- appveyor.yml => .appveyor.yml | 0 {ci => .ci-local}/appveyor-make.bat | 0 {ci => .ci-local}/appveyor-prepare.bat | 0 {ci => .ci-local}/travis-build.sh | 0 {ci => .ci-local}/travis-prepare.sh | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename appveyor.yml => .appveyor.yml (100%) rename {ci => .ci-local}/appveyor-make.bat (100%) rename {ci => .ci-local}/appveyor-prepare.bat (100%) rename {ci => .ci-local}/travis-build.sh (100%) rename {ci => .ci-local}/travis-prepare.sh (100%) diff --git a/appveyor.yml b/.appveyor.yml similarity index 100% rename from appveyor.yml rename to .appveyor.yml diff --git a/ci/appveyor-make.bat b/.ci-local/appveyor-make.bat similarity index 100% rename from ci/appveyor-make.bat rename to .ci-local/appveyor-make.bat diff --git a/ci/appveyor-prepare.bat b/.ci-local/appveyor-prepare.bat similarity index 100% rename from ci/appveyor-prepare.bat rename to .ci-local/appveyor-prepare.bat diff --git a/ci/travis-build.sh b/.ci-local/travis-build.sh similarity index 100% rename from ci/travis-build.sh rename to .ci-local/travis-build.sh diff --git a/ci/travis-prepare.sh b/.ci-local/travis-prepare.sh similarity index 100% rename from ci/travis-prepare.sh rename to .ci-local/travis-prepare.sh From a9c8d8d5d307fa17e3d2fa65ccdfb7c832ce8596 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Fri, 24 Apr 2020 15:11:00 +0200 Subject: [PATCH 16/21] Add ci-scripts v2.3.2 (submodule in .ci) --- .ci | 1 + .gitmodules | 4 ++++ 2 files changed, 5 insertions(+) create mode 160000 .ci create mode 100644 .gitmodules diff --git a/.ci b/.ci new file mode 160000 index 000000000..d0f93f192 --- /dev/null +++ b/.ci @@ -0,0 +1 @@ +Subproject commit d0f93f1920b5ccde78766d9f84cca292047933ec diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..271d6c8f0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule ".ci"] + path = .ci + url = https://github.com/epics-base/ci-scripts + branch = master From 445cbb822116028aea727ef99dbe94925d51e62a Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Fri, 24 Apr 2020 19:26:47 +0200 Subject: [PATCH 17/21] travis-ci: update .travis.yml for ci-scripts - use more EXTRAs on MacOS for make args --- .travis.yml | 133 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 51 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0ae572504..5edb00dcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,62 +1,93 @@ -language: c +# .travis.yml for use with EPICS Base ci-scripts +# (see: https://github.com/epics-base/ci-scripts) -matrix: - include: - - sudo: false - dist: bionic - compiler: gcc - env: CMPLR=gcc - - sudo: false - dist: xenial - compiler: gcc - env: CMPLR=gcc - - sudo: false - dist: bionic - compiler: gcc - env: CMPLR=gcc CMD_CXXFLAGS=-std=c++11 - - sudo: false - dist: trusty - compiler: gcc - env: CMPLR=gcc STATIC=YES CMD_CXXFLAGS=-std=c++11 - - sudo: false - dist: bionic - compiler: gcc - env: CMPLR=clang - - sudo: false - dist: xenial - compiler: gcc - env: CMPLR=clang - - sudo: false - dist: trusty - compiler: gcc - env: CMPLR=clang STATIC=YES - - sudo: false - dist: trusty - compiler: gcc - env: WINE=32 TEST=NO STATIC=YES - - sudo: false - dist: trusty - compiler: gcc - env: WINE=32 TEST=NO STATIC=NO - - sudo: false - dist: trusty - compiler: gcc - env: RTEMS=4.10 TEST=NO - - sudo: false - dist: trusty - compiler: gcc - env: RTEMS=4.9 TEST=NO - - os: osx - env: CMD_CFLAGS="-mmacosx-version-min=10.7" CMD_CXXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" CMD_LDXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" +language: cpp +compiler: gcc +dist: xenial + +cache: + directories: + - $HOME/.cache + +env: + global: + - SETUP_PATH=.ci-local:.ci + - BASE=SELF addons: apt: packages: + # for all EPICS builds - libreadline6-dev - libncurses5-dev - perl + # for clang compiler - clang + # for mingw builds (32bit and 64bit) - g++-mingw-w64-i686 + - g++-mingw-w64-x86-64 + # for RTEMS cross builds + - qemu-system-x86 + homebrew: + packages: + # for all EPICS builds + - bash + update: true -install: sh ci/travis-prepare.sh Date: Wed, 22 Apr 2020 16:54:23 +0200 Subject: [PATCH 18/21] appveyor: update .appveyor.yml for ci-scripts --- .appveyor.yml | 92 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 27 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index bc04839e5..6a289f6ea 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,11 +1,18 @@ -# AppVeyor configuration for EPICS Base - -# Ralph Lange -# Copyright (c) 2016-2017 ITER Organization +# .appveyor.yml for use with EPICS Base ci-scripts +# (see: https://github.com/epics-base/ci-scripts) # Version format version: base-{branch}-{build} +#---------------------------------# +# build cache # +#---------------------------------# +# The AppVeyor cache allowance is way too small (1GB per account across all projects, branches and jobs) +# to be used for the dependency builds. + +cache: + - C:\Users\appveyor\.tools + #---------------------------------# # repository cloning # #---------------------------------# @@ -16,7 +23,7 @@ init: - git config --global core.autocrlf true # Set clone depth (do not fetch complete history) -clone_depth: 2 +clone_depth: 5 # Skipping commits affecting only specific files skip_commits: @@ -37,47 +44,78 @@ configuration: - dynamic-debug - static-debug -# Environment variables: compiler toolchain +# Environment variables: compiler toolchain, base version, setup file, ... environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 10.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 11.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 12.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 14.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - TOOLCHAIN: 2017 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: mingw + # common / default variables for all jobs + SETUP_PATH: .ci-local:.ci + BASE: SELF -# Platform: architecture + matrix: + - CMP: vs2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + - CMP: vs2017 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - CMP: vs2015 + - CMP: vs2013 + - CMP: vs2012 + - CMP: vs2010 + - CMP: mingw + +# Platform: processor architecture platform: - x86 - x64 -# Matrix configuration: allow specific failing jobs +# Matrix configuration: exclude sets of jobs matrix: exclude: - # VS Express installs don't have the 64 bit compiler + # VS2012 and older installs don't have the 64 bit compiler - platform: x64 - TOOLCHAIN: 10.0 - + CMP: vs2012 + - platform: x64 + CMP: vs2010 + - platform: x64 + CMP: vs2008 + # Exclude more jobs to reduce build time + # Skip 32-bit for "middle-aged" compilers + - platform: x86 + CMP: vs2017 + - platform: x86 + CMP: vs2015 #---------------------------------# # building & testing # #---------------------------------# install: - - cmd: ci/appveyor-prepare.bat + - cmd: git submodule update --init --recursive + - cmd: python .ci/appveyor/do.py prepare build_script: - - cmd: ci/appveyor-make.bat + - cmd: python .ci/appveyor/do.py build test_script: - - cmd: ci/appveyor-make.bat runtests + - cmd: python .ci/appveyor/do.py test + +on_finish: + - ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + - cmd: python .ci/appveyor/do.py build test-results -s + +#---------------------------------# +# debugging # +#---------------------------------# + +## if you want to connect by remote desktop to a failed build, uncomment these lines +## note that you will need to connect within the usual build timeout limit (60 minutes) +## so you may want to adjust the build matrix above to just build the one of interest + +# print the connection info +#init: +# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + +# block a failed build (until the watchdog barks) +#on_failure: +# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) #---------------------------------# # notifications # From 076175386f9ef220884607a52422364f11a94418 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Fri, 24 Apr 2020 15:24:43 +0200 Subject: [PATCH 19/21] ci: remove old integration in .ci-local --- .ci-local/appveyor-make.bat | 119 --------------------------------- .ci-local/appveyor-prepare.bat | 38 ----------- .ci-local/travis-build.sh | 88 ------------------------ .ci-local/travis-prepare.sh | 24 ------- 4 files changed, 269 deletions(-) delete mode 100644 .ci-local/appveyor-make.bat delete mode 100644 .ci-local/appveyor-prepare.bat delete mode 100644 .ci-local/travis-build.sh delete mode 100644 .ci-local/travis-prepare.sh diff --git a/.ci-local/appveyor-make.bat b/.ci-local/appveyor-make.bat deleted file mode 100644 index 8d976d93d..000000000 --- a/.ci-local/appveyor-make.bat +++ /dev/null @@ -1,119 +0,0 @@ -:: Universal build script for AppVeyor (https://ci.appveyor.com/) -:: Environment: -:: TOOLCHAIN - toolchain version [10.0/11.0/12.0/14.0/2017/mingw] -:: CONFIGURATION - determines EPICS build [dynamic/static] -:: PLATFORM - architecture [x86/x64] -:: -:: All command line args are passed to make - -Setlocal EnableDelayedExpansion - -set "ST=" -if /i "%CONFIGURATION%"=="static" set ST=-static - -set OS=64BIT -if "%PLATFORM%"=="x86" set OS=32BIT - -echo [INFO] Platform: %OS% - -:: Use parallel make, except for 3.14 -set "MAKEARGS=-j2 -Otarget" -if "%APPVEYOR_REPO_BRANCH%"=="3.14" set MAKEARGS= - -if "%TOOLCHAIN%"=="mingw" ( - set "MAKE=mingw32-make" - if "%OS%"=="64BIT" ( - set "EPICS_HOST_ARCH=windows-x64-mingw" - set "INCLUDE=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\include;%INCLUDE%" - set "PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%" - echo [INFO] MinGW Toolchain 64bit - ) else ( - set "EPICS_HOST_ARCH=win32-x86-mingw" - set "INCLUDE=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\include;%INCLUDE%" - set "PATH=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin;%PATH%" - echo [INFO] MinGW Toolchain 32bit - ) - echo [INFO] Compiler Version - gcc -v - goto Finish -) - -set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN%" -if not exist "%VSINSTALL%\" set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio\%TOOLCHAIN%\Community" -if not exist "%VSINSTALL%\" goto MSMissing - -set "MAKE=C:\tools\make" - -echo [INFO] APPVEYOR_BUILD_WORKER_IMAGE=%APPVEYOR_BUILD_WORKER_IMAGE% - -if "%OS%"=="64BIT" ( - set EPICS_HOST_ARCH=windows-x64%ST% - :: VS 2017 - if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" ( - call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) - if exist "%VSINSTALL%\VC\vcvarsall.bat" ( - call "%VSINSTALL%\VC\vcvarsall.bat" amd64 - where cl - if !ERRORLEVEL! NEQ 0 ( - call "%VSINSTALL%\VC\vcvarsall.bat" x86_amd64 - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - ) - goto MSFound - ) - if exist "%VSINSTALL%\VC\bin\amd64\vcvars64.bat" ( - call "%VSINSTALL%\VC\bin\amd64\vcvars64.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) -) else ( - set EPICS_HOST_ARCH=win32-x86%ST% - :: VS 2017 - if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat" ( - call "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) - if exist "%VSINSTALL%\VC\vcvarsall.bat" ( - call "%VSINSTALL%\VC\vcvarsall.bat" x86 - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) - if exist "%VSINSTALL%\VC\bin\vcvars32.bat" ( - call "%VSINSTALL%\VC\bin\vcvars32.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) - if exist "%VSINSTALL%\Common7\Tools\vsvars32.bat" ( - call "%VSINSTALL%\Common7\Tools\vsvars32.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) -) - -:MSMissing -echo [INFO] Installation for MSVC Toolchain %TOOLCHAIN% / %OS% seems to be missing -exit 1 - -:MSFound -echo [INFO] Microsoft Visual Studio Toolchain %TOOLCHAIN% -echo [INFO] Compiler Version -cl - -:Finish -echo [INFO] EPICS_HOST_ARCH: %EPICS_HOST_ARCH% -echo [INFO] Make version -%MAKE% --version -echo [INFO] Perl version -perl --version - -%MAKE% %MAKEARGS% %* diff --git a/.ci-local/appveyor-prepare.bat b/.ci-local/appveyor-prepare.bat deleted file mode 100644 index a685dbfb3..000000000 --- a/.ci-local/appveyor-prepare.bat +++ /dev/null @@ -1,38 +0,0 @@ -:: Build script for AppVeyor (https://ci.appveyor.com/) -:: Environment: -:: TOOLCHAIN - Toolchain Version [9.0/10.0/11.0/12.0/14.0/mingw] -:: CONFIGURATION - determines EPICS build [dynamic/static, -debug] -:: PLATFORM - "x86" -> use 32bit architecture -:: -:: Prepares an Appveyor build by excuting the following steps -:: - Set up configure\CONFIG_SITE for static vs. dynamic build -:: - Install Mingw (TOOLCHAIN setting) in the in the appropriate flavor -:: - Download and install Make-4.1 from EPICS download page - -Setlocal EnableDelayedExpansion - -set OS=64BIT -if "%PLATFORM%"=="x86" set OS=32BIT - -echo [INFO] Platform: %OS% - -if "%TOOLCHAIN%"=="mingw" ( - echo.%CONFIGURATION% | findstr /C:"static">nul && ( - echo SHARED_LIBRARIES=NO>> configure\CONFIG_SITE - echo STATIC_BUILD=YES>> configure\CONFIG_SITE - echo [INFO] EPICS set up for static build - ) || ( - echo [INFO] EPICS set up for dynamic build - ) - echo.%CONFIGURATION% | findstr /C:"debug">nul && ( - echo HOST_OPT=NO>> configure\CONFIG_SITE - echo [INFO] EPICS set up for debug build - ) || ( - echo [INFO] EPICS set up for optimized build - ) -) - -echo [INFO] Installing Make 4.2.1 from ANL web site -curl -fsS --retry 3 -o C:\tools\make-4.2.1.zip https://epics.anl.gov/download/tools/make-4.2.1-win64.zip -cd \tools -"C:\Program Files\7-Zip\7z" e make-4.2.1.zip diff --git a/.ci-local/travis-build.sh b/.ci-local/travis-build.sh deleted file mode 100644 index e69616aa3..000000000 --- a/.ci-local/travis-build.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -set -e -x - -die() { - echo "$1" >&2 - exit 1 -} - -ticker() { - while true - do - sleep 60 - date -R - [ -r "$1" ] && tail -n10 "$1" - done -} - -CACHEKEY=1 - -EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl` - -[ -e configure/os/CONFIG_SITE.Common.linux-x86 ] || die "Wrong location: $PWD" - -case "$CMPLR" in -clang) - echo "Host compiler is clang" - cat << EOF >> configure/os/CONFIG_SITE.Common.$EPICS_HOST_ARCH -GNU = NO -CMPLR_CLASS = clang -CC = clang -CCC = clang++ -EOF - ;; -*) echo "Host compiler is default";; -esac - -if [ "$STATIC" = "YES" ] -then - echo "Build static libraries/executables" - cat << EOF >> configure/CONFIG_SITE -SHARED_LIBRARIES=NO -STATIC_BUILD=YES -EOF -fi - -# requires wine and g++-mingw-w64-i686 -if [ "$WINE" = "32" ] -then - echo "Cross mingw32" - sed -i -e '/CMPLR_PREFIX/d' configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw - cat << EOF >> configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw -CMPLR_PREFIX=i686-w64-mingw32- -EOF - cat << EOF >> configure/CONFIG_SITE -CROSS_COMPILER_TARGET_ARCHS+=win32-x86-mingw -EOF -fi - -# set RTEMS to eg. "4.9" or "4.10" -# requires qemu, bison, flex, texinfo, install-info -if [ -n "$RTEMS" ] -then - echo "Cross RTEMS${RTEMS} for pc386" - install -d /home/travis/.cache - curl -L "https://github.com/mdavidsaver/rsb/releases/download/travis-20160306-2/rtems${RTEMS}-i386-trusty-20190306-2.tar.gz" \ - | tar -C /home/travis/.cache -xj - - sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' configure/os/CONFIG_SITE.Common.RTEMS - cat << EOF >> configure/os/CONFIG_SITE.Common.RTEMS -RTEMS_VERSION=$RTEMS -RTEMS_BASE=/home/travis/.cache/rtems${RTEMS}-i386 -EOF - cat << EOF >> configure/CONFIG_SITE -CROSS_COMPILER_TARGET_ARCHS+=RTEMS-pc386 -EOF - - # find local qemu-system-i386 - echo -n "Using QEMU: " - type qemu-system-i386 || echo "Missing qemu" -fi - -make -j2 RTEMS_QEMU_FIXUPS=YES CMD_CFLAGS="${CMD_CFLAGS}" CMD_CXXFLAGS="${CMD_CXXFLAGS}" CMD_LDFLAGS="${CMD_LDFLAGS}" - -if [ "$TEST" != "NO" ] -then - make tapfiles - make -s test-results -fi diff --git a/.ci-local/travis-prepare.sh b/.ci-local/travis-prepare.sh deleted file mode 100644 index 393bd80b6..000000000 --- a/.ci-local/travis-prepare.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -set -e -x - -die() { - echo "$1" >&2 - exit 1 -} - -if [ -f /etc/hosts ] -then - # The travis-ci "bionic" image throws us a curveball in /etc/hosts - # by including two entries for localhost. The first for 127.0.1.1 - # which causes epicsSockResolveTest to fail. - # cat /etc/hosts - # ... - # 127.0.1.1 localhost localhost ip4-loopback - # 127.0.0.1 localhost nettuno travis vagrant travis-job-.... - - sudo sed -i -e '/^127\.0\.1\.1/ s|localhost\s*||g' /etc/hosts - - echo "==== /etc/hosts" - cat /etc/hosts - echo "====" -fi From 314e09d8cab21632c6d9212bd6808001cb67915f Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 24 Apr 2020 16:44:49 -0500 Subject: [PATCH 20/21] Build system release notes --- documentation/RELEASE_NOTES.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index 0bb0b8ac9..6217fa9a2 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -6,6 +6,28 @@ This version of EPICS Base has not been released yet. +### Improvements to the self-test build targets + +This release contains changes that make it possible to integrate another test +running and reporting system (such as Google's gtest) into the EPICS build +system. The built-in test-runner and reporting system will continue to be used +by the test programs inside Base however. + +These GNUmake `tapfiles` and `test-results` build targets now collect a list of +the directories that experienced test failures and display those at the end of +running and/or reporting all of the tests. The GNUmake process will also only +exit with an error status after running and/or reporting all of the test +results; previously the `-k` flag to make was needed and even that didn't always +work. + +Continuous Integration systems are recommended to run `make tapfiles` (or if +they can read junittest output instead of TAP `make junitests`) followed by +`make -s test-results` to display the results of the tests. If multiple CPUs are +available the `-j` flag can be used to run tests in parallel, giving the maximum +jobs that should be allowed so `make -j4 tapfiles` for a system with 4 CPUs say. +Running many more jobs than you have CPUs is likely to be slower and is not +recommended. + ### epicsThread: Main thread defaults to allow blocking I/O VxWorks IOCs (and potentially RTEMS IOCs running GeSys) have had problems with From 0aa6e9603bf1dcd689986577af056365d2745980 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Fri, 24 Apr 2020 19:18:01 +0200 Subject: [PATCH 21/21] Update .ci submodule to v2.3.3 - fix appveyor issue when building base - fix RTEMS cross build for Base 3.15 - run tests using parallel make --- .ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci b/.ci index d0f93f192..e91a58837 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit d0f93f1920b5ccde78766d9f84cca292047933ec +Subproject commit e91a5883704e9fa57792953436eb7020baf37063