Need to parse the correct valgrind.log when running multiple tests in parallel.
Török Edvin authored on 2010/09/28 19:46:33... | ... |
@@ -107,6 +107,7 @@ test_run_check() { |
107 | 107 |
test_end() { |
108 | 108 |
killclamd |
109 | 109 |
cd .. |
110 |
+ test -f test-$1/valgrind.log && mv -f test-$1/valgrind.log valgrind$1.log |
|
110 | 111 |
rm -rf test-$1 |
111 | 112 |
} |
112 | 113 |
|
... | ... |
@@ -137,10 +138,11 @@ init_helgrind() { |
137 | 137 |
} |
138 | 138 |
|
139 | 139 |
end_valgrind() { |
140 |
- NRUNS=`grep -a "ERROR SUMMARY" valgrind.log | wc -l` |
|
141 |
- if test $NRUNS -ne `grep -a "ERROR SUMMARY: 0 errors" valgrind.log | wc -l` || |
|
142 |
- test `grep -a "FATAL:" valgrind.log|wc -l` -ne 0; then |
|
143 |
- cat valgrind.log |
|
140 |
+ VLOG=valgrind$1.log |
|
141 |
+ NRUNS=`grep -a "ERROR SUMMARY" $VLOG | wc -l` |
|
142 |
+ if test $NRUNS -ne `grep -a "ERROR SUMMARY: 0 errors" $VLOG | wc -l` || |
|
143 |
+ test `grep -a "FATAL:" $VLOG|wc -l` -ne 0; then |
|
144 |
+ cat $VLOG |
|
144 | 145 |
die "Valgrind tests failed" |
145 | 146 |
fi |
146 | 147 |
} |
... | ... |
@@ -365,7 +365,7 @@ static void do_phishing_test(const struct rtest *rtest) |
365 | 365 |
{ |
366 | 366 |
char *realurl; |
367 | 367 |
cli_ctx ctx; |
368 |
- const char *virname; |
|
368 |
+ const char *virname = NULL; |
|
369 | 369 |
tag_arguments_t hrefs; |
370 | 370 |
int rc; |
371 | 371 |
|
... | ... |
@@ -417,8 +417,9 @@ static void do_phishing_test(const struct rtest *rtest) |
417 | 417 |
fail_unless_fmt(ctx.found_possibly_unwanted, |
418 | 418 |
"this should be blacklisted, realURL: %s, displayURL: %s", |
419 | 419 |
rtest->realurl, rtest->displayurl); |
420 |
- fail_unless_fmt(!strstr((const char*)ctx.virname,"Blacklisted"), |
|
421 |
- "should be blacklisted, but is: %s\n", ctx.virname); |
|
420 |
+ if (*ctx.virname) |
|
421 |
+ fail_unless_fmt(!strstr((const char*)*ctx.virname,"Blacklisted"), |
|
422 |
+ "should be blacklisted, but is: %s\n", ctx.virname); |
|
422 | 423 |
} |
423 | 424 |
break; |
424 | 425 |
} |