From 1d4634cb92eb0509c979b7236c03dfd8d8762e9b Mon Sep 17 00:00:00 2001 From: "benjamin.franksen" <benjamin.franksen@helmholtz-berlin.de> Date: Fri, 12 Jul 2013 14:41:38 +0000 Subject: [PATCH] test: ensure that tests cover seq exit phase --- test/validate/makeTestfile.pl | 4 ++-- test/validate/testSupport.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/validate/makeTestfile.pl b/test/validate/makeTestfile.pl index 38582e42..d235120f 100644 --- a/test/validate/makeTestfile.pl +++ b/test/validate/makeTestfile.pl @@ -59,11 +59,11 @@ $killit; EOF } elsif (-r "$db") { print $OUT <<EOF; -exec "$valgrind./$exe -S -t -d $db" or die "exec failed: $err"; +system "$valgrind./$exe -S -t -d $db"; EOF } else { print $OUT <<EOF; -exec "$valgrind./$exe -S -t" or die "exec failed: $err"; +system "$valgrind./$exe -S -t"; EOF } diff --git a/test/validate/testSupport.c b/test/validate/testSupport.c index 3d23a671..53f0e4e6 100644 --- a/test/validate/testSupport.c +++ b/test/validate/testSupport.c @@ -8,6 +8,7 @@ in the file LICENSE that is included with this distribution. #include "epicsThread.h" #include "epicsEvent.h" +#include "epicsExit.h" #include "seqCom.h" #include "../testSupport.h" @@ -44,6 +45,11 @@ void seq_test_init(int num_tests) } } +void seq_test_at_thread_exit(void *dummy) +{ + epicsExit(EXIT_SUCCESS); +} + void seq_test_done(void) { epicsThreadSetPriority(epicsThreadGetIdSelf(), epicsThreadPriorityMedium); @@ -51,7 +57,7 @@ void seq_test_done(void) #if defined(vxWorks) epicsEventSignal(this_test_done); #else - exit(0); + epicsAtThreadExit(seq_test_at_thread_exit, 0); #endif } -- GitLab