Skip to content
Snippets Groups Projects
Commit 842213ec authored by benjamin.franksen's avatar benjamin.franksen
Browse files

test/validate: fixed Makefile and makeTestfile.pl so tests work on win32, too

parent 3b523e83
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,9 @@ seqSoftIoc_DBD += base.dbd
seqSoftIoc_SRCS += seqSoftIoc_registerRecordDeviceDriver.cpp
seqSoftIoc_LIBS += seq pv
seqSoftIoc_LIBS += $(EPICS_BASE_IOC_LIBS)
ifeq '$(EPICS_HAS_UNIT_TEST)' '1'
seqSoftIoc_SRCS += testSupport.c
......@@ -92,19 +95,21 @@ include $(TOP)/configure/RULES
#----------------------------------------
# ADD RULES AFTER THIS LINE
SOFTIOC=$(EPICS_BASE_BIN)/softIoc$(HOSTEXE)
SOFTDBD=$(EPICS_BASE)/dbd/softIoc.dbd
$(REGRESSION_TESTS_WITH_DB:%=%Ioc.t): %Ioc.t: %$(EXE) ../makeTestfile.pl
$(RM) $@
$(PERL) ../makeTestfile.pl $@ $* $< ioc
$(PERL) ../makeTestfile.pl $@ $* $< ioc $(SOFTIOC) $(SOFTDBD) $(EPICS_HOST_ARCH)
$(REGRESSION_TESTS:%=%.t): %.t: %$(EXE) ../makeTestfile.pl
$(RM) $@
$(PERL) ../makeTestfile.pl $@ $* $< noioc
$(PERL) ../makeTestfile.pl $@ $* $< noioc $(SOFTIOC) $(SOFTDBD) $(EPICS_HOST_ARCH)
norace.i race.i: ../raceCommon.st
$(COMMON_DIR)/vxTestHarnessRegistrars.dbd:
$(RM) $@
$(foreach t,$(REGRESSION_TESTS),echo 'registrar($tTestRegistrar)' >> $@;)
$(PERL) -e "foreach (qw($(REGRESSION_TESTS))) {print qq(registrar($${_}TestRegistrar)\n)}" > $@
$(COMMON_DIR)/vxTestHarness.dbd: $(COMMON_DIR)/vxTestHarnessRegistrars.dbd
......@@ -114,7 +119,7 @@ $(COMMON_DIR)/vxTestHarness.db: $(REGRESSION_TESTS_WITH_DB:%=../%.db)
st.cmd: ../st.cmd.vxWorks
$(CP) $< $@
$(foreach t,$(REGRESSION_TESTS),echo "run_seq_test &$tTest" >> $@;)
$(PERL) -e "foreach (qw($(REGRESSION_TESTS))) {print qq(run_seq_test &$${_}Test\n)}" >> $@
ifeq "$(OS_CLASS)" "vxWorks"
build: st.cmd
......
......@@ -19,25 +19,34 @@
use strict;
my ($target, $stem, $exe, $ioc) = @ARGV;
my ($target, $stem, $exe, $ioc, $softioc, $softdbd) = @ARGV;
my $db = "../$stem.db";
my $host_arch = $ENV{EPICS_HOST_ARCH};
open(my $OUT, ">", $target) or die "Can't create $target: $!\n";
my $pid = '$pid';
my $err = '$!';
my $killit;
if ($host_arch =~ /win32/) {
$killit = 'system("taskkill /F /IM softIoc.exe")';
} else {
$killit = 'kill 9, $pid or die "kill failed: $!"';
}
if ($ioc eq "ioc") {
print $OUT <<EOF;
my $pid = fork();
die "fork failed: $err" unless defined($pid);
if (!$pid) {
exec("softIoc -S -d $db");
exec("$softioc -D $softdbd -S -d $db");
die "exec failed: $err";
}
system("./$exe -S");
kill 9, $pid or die "kill failed: $err";
$killit;
EOF
} elsif (-r "$db") {
print $OUT <<EOF;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment