Skip to content

Commit

Permalink
Made -s/--segfault-recovery flag to the test suite runner an option
Browse files Browse the repository at this point in the history
  • Loading branch information
aiobofh committed Sep 19, 2017
1 parent b91a216 commit f0cc101
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions examples/simple.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <assert.h>
#include <stdlib.h>
/*
* The practice of test-driven design
Expand Down
12 changes: 5 additions & 7 deletions src/cutest.h
Original file line number Diff line number Diff line change
Expand Up @@ -852,21 +852,23 @@ static void cutest_startup(int argc, char* argv[],
if ((0 == strcmp(argv[i], "-v")) ||
(0 == strcmp(argv[i], "--verbose"))) {
cutest_opts.verbose = 1;
continue;
}
if ((0 == strcmp(argv[i], "-j")) ||
(0 == strcmp(argv[i], "--junit"))) {
cutest_opts.junit = 1;
continue;
}
if ((0 == strcmp(argv[i], "-n")) ||
(0 == strcmp(argv[i], "--no-linefeed"))) {
cutest_opts.no_linefeed = 1;
continue;
}
/*
if ((0 == strcmp(argv[i], "-s")) ||
(0 == strcmp(argv[i], "--segfault-recovery"))) {
cutest_opts.segfault_recovery = 1;
continue;
}
*/

strcpy(cutest_tests_to_run.test_name[cutest_tests_to_run.cnt++], argv[i]);
}
Expand All @@ -877,13 +879,9 @@ static void cutest_startup(int argc, char* argv[],
strcpy(cutest_stats.suite_name, suite_name);
strcpy(cutest_stats.design_under_test, suite_name);

/*
if (1 == cutest_opts.segfault_recovery) {
*/
signal(SIGSEGV, cutest_segfault_handler);
/*
signal(SIGSEGV, cutest_segfault_handler);
}
*/
}

/*
Expand Down
4 changes: 2 additions & 2 deletions src/cutest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ check:: missing toomany $(subst .c,,$(wildcard $(CUTEST_TEST_DIR)/*_test.c))
processors=`cat /proc/cpuinfo | grep processor | wc -l`; \
for i in $(filter-out toomany,$(filter-out missing,$^)); do \
while [ `ps xa | grep -v grep | grep '_test ' | wc -l` -gt $$processors ]; do sleep 0.1; done; \
./$$i $V -j || rm $$i || R=false & \
./$$i $V -j -s || rm $$i || R=false & \
done; \
while [ `ps xa | grep -v grep | grep '_test ' | wc -l` -gt 0 ]; do \
sleep 1; \
Expand All @@ -186,7 +186,7 @@ valgrind:: missing toomany $(subst .c,,$(wildcard $(CUTEST_TEST_DIR)/*_test.c))
processors=`cat /proc/cpuinfo | grep processor | wc -l`; \
for i in $(filter-out toomany,$(filter-out missing,$^)); do \
while [ `ps xa | grep -v grep | grep '_test ' | wc -l` -gt $$processors ]; do sleep 0.1; done; \
valgrind -q ./$$i -v -j || rm $$i || R=false & \
valgrind -q ./$$i -v -j -s || rm $$i || R=false & \
done; \
while [ `ps xa | grep -v grep | grep '_test ' | wc -l` -gt 0 ]; do \
sleep 1; \
Expand Down

0 comments on commit f0cc101

Please sign in to comment.