From 9b715dfc40311247b08daf5fa8695a95fd66106f Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 12 Sep 2014 17:03:35 -0700 Subject: [tests] Set --output-dir on all test runs, in support of running tests in parallel. - It would be nice if there was an easier way to do this that didn't involve editing all of the tests (like running each test in its own directory), but this approach fixes #146 and doesn't involve changing 'lit' or writing a wrapper harness. My assumption is a lot of tests start are derived from another one, so hopefully following this convention won't be burdensome, and I updated 'make check' so that it will produce an error if any test runs klee without --output-dir (by checking for the existing of klee-last files). - This also helps with #147 but I still can't fully run tests in parallel (I start hitting STP errors). --- test/Feature/WriteCov.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'test/Feature/WriteCov.c') diff --git a/test/Feature/WriteCov.c b/test/Feature/WriteCov.c index 45e7bc43..3ecce3fc 100644 --- a/test/Feature/WriteCov.c +++ b/test/Feature/WriteCov.c @@ -1,20 +1,21 @@ // RUN: %llvmgcc %s -emit-llvm -g -c -o %t2.bc -// RUN: %klee --exit-on-error --write-cov %t2.bc -// RUN: grep -c WriteCov.c:15 %T/klee-last/test000001.cov %T/klee-last/test000002.cov >%t3.txt -// RUN: grep -c WriteCov.c:17 %T/klee-last/test000001.cov %T/klee-last/test000002.cov >>%t3.txt -// RUN: grep klee-last/test000001.cov:0 %t3.txt -// RUN: grep klee-last/test000001.cov:1 %t3.txt -// RUN: grep klee-last/test000002.cov:0 %t3.txt -// RUN: grep klee-last/test000002.cov:1 %t3.txt +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --exit-on-error --write-cov %t2.bc +// RUN: grep -c WriteCov.c:16 %t.klee-out/test000001.cov %t.klee-out/test000002.cov >%t3.txt +// RUN: grep -c WriteCov.c:18 %t.klee-out/test000001.cov %t.klee-out/test000002.cov >>%t3.txt +// RUN: grep %t.klee-out/test000001.cov:0 %t3.txt +// RUN: grep %t.klee-out/test000001.cov:1 %t3.txt +// RUN: grep %t.klee-out/test000002.cov:0 %t3.txt +// RUN: grep %t.klee-out/test000002.cov:1 %t3.txt #include #include int main() { if (klee_range(0,2, "range")) { - assert(__LINE__ == 15); printf("__LINE__ = %d\n", __LINE__); + assert(__LINE__ == 16); printf("__LINE__ = %d\n", __LINE__); } else { - assert(__LINE__ == 17); printf("__LINE__ = %d\n", __LINE__); + assert(__LINE__ == 18); printf("__LINE__ = %d\n", __LINE__); } return 0; } -- cgit 1.4.1