From: Rusty Russell Date: Tue, 15 Feb 2011 12:49:00 +0000 (+1030) Subject: failtest: allow continuing after running a failpath. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=1605358b20327a8d384750cc2f840ed3a2ea224f failtest: allow continuing after running a failpath. Append a "+" if you want to start forking as normal. --- diff --git a/ccan/failtest/failtest.c b/ccan/failtest/failtest.c index 598a9e79..4f71a63d 100644 --- a/ccan/failtest/failtest.c +++ b/ccan/failtest/failtest.c @@ -280,11 +280,16 @@ static bool should_fail(struct failtest_call *call) return false; if (failpath) { - if (tolower(*failpath) != info_to_arg[call->type]) - errx(1, "Failpath expected '%c' got '%c'\n", - info_to_arg[call->type], *failpath); - call->fail = isupper(*(failpath++)); - return call->fail; + /* + means continue after end, like normal. */ + if (*failpath == '+') + failpath = NULL; + else { + if (tolower(*failpath) != info_to_arg[call->type]) + errx(1, "Failpath expected '%c' got '%c'\n", + info_to_arg[call->type], *failpath); + call->fail = isupper(*(failpath++)); + return call->fail; + } } if (!failtest_hook(history, history_num)) {