From 07d6c6d5d1f7a1e304dbd9b5cfab2e1ce14fc64a Mon Sep 17 00:00:00 2001
From: "benjamin.franksen" <benjamin.franksen@helmholtz-berlin.de>
Date: Thu, 12 Apr 2012 11:43:44 +0000
Subject: [PATCH] test: better support for testing on vxWorks

---
 test/validate/assign.st        | 2 ++
 test/validate/change.st        | 2 ++
 test/validate/makeStCmd.pl     | 8 ++++----
 test/validate/monitorEvflag.st | 4 ++--
 test/validate/raceCommon.st    | 2 +-
 test/validate/testSupport.c    | 2 ++
 6 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/test/validate/assign.st b/test/validate/assign.st
index 28e31161..bb2b3f52 100644
--- a/test/validate/assign.st
+++ b/test/validate/assign.st
@@ -6,6 +6,8 @@ in the file LICENSE that is included with this distribution.
 \*************************************************************************/
 program assignTest
 
+option +r;
+
 %%#include "../testSupport.h"
 
 int x = 0;
diff --git a/test/validate/change.st b/test/validate/change.st
index 01246ae7..76e9b07a 100644
--- a/test/validate/change.st
+++ b/test/validate/change.st
@@ -7,6 +7,8 @@ in the file LICENSE that is included with this distribution.
 /* Test state change statement */
 program changeTest
 
+option +r;
+
 %%#include <time.h>
 %%#include <stdlib.h>
 %%#include "../testSupport.h"
diff --git a/test/validate/makeStCmd.pl b/test/validate/makeStCmd.pl
index 68461fe6..d89a4fef 100644
--- a/test/validate/makeStCmd.pl
+++ b/test/validate/makeStCmd.pl
@@ -1,10 +1,10 @@
 print "testHarness\n";
 foreach my $x (@ARGV) {
-  print "# ...with lowered priority\n";
+  print "\n# with lowered priority:\n";
   print "run_seq_test \&${x}Test, -1\n";
-  print "# ...with normal priority\n";
+  print "\n# with normal priority:\n";
   print "run_seq_test \&${x}Test\n";
-  print "# ...with raised priority\n";
+  print "\n# with raised priority:\n";
   print "run_seq_test \&${x}Test, 1\n";
 }
-print "epicsExit\n";
+print "\nepicsExit\n";
diff --git a/test/validate/monitorEvflag.st b/test/validate/monitorEvflag.st
index 4a98179e..63f0ba3d 100644
--- a/test/validate/monitorEvflag.st
+++ b/test/validate/monitorEvflag.st
@@ -5,8 +5,8 @@ option +s;
 %%#include "../testSupport.h"
 %%#include <stdio.h>
 
-#define NDIAGS 100
-#define NCYCLESPERDIAG 1000
+#define NDIAGS 20
+#define NCYCLESPERDIAG 500
 #define NCYCLES (NDIAGS*NCYCLESPERDIAG)
 
 int requested;
diff --git a/test/validate/raceCommon.st b/test/validate/raceCommon.st
index f3d09152..bff5e3bb 100644
--- a/test/validate/raceCommon.st
+++ b/test/validate/raceCommon.st
@@ -18,7 +18,7 @@ sync x to efx;
 
 foreign MAX_STRING_SIZE;
 
-#define MAX_TESTS 5
+#define MAX_TESTS 10
 
 entry {
     seq_test_init(MAX_TESTS);
diff --git a/test/validate/testSupport.c b/test/validate/testSupport.c
index 79bd4267..d1227924 100644
--- a/test/validate/testSupport.c
+++ b/test/validate/testSupport.c
@@ -31,6 +31,7 @@ void run_seq_test(seqProgram *seqProg, int adapt_priority)
     prog = seqProg;
     runTestFunc(seqProg->progName, doit);
     epicsEventWait(this_test_done);
+    epicsThreadSleep(1.0);
 }
 
 void seq_test_init(int num_tests)
@@ -45,6 +46,7 @@ void seq_test_init(int num_tests)
 
 void seq_test_done(void)
 {
+    epicsThreadSetPriority(epicsThreadGetIdSelf(), epicsThreadPriorityMedium);
     testDone();
 #if defined(vxWorks)
     epicsEventSignal(this_test_done);
-- 
GitLab