]> git.ozlabs.org Git - ccan/blobdiff - ccan/failtest/failtest.c
failtest: allow continuing after running a failpath.
[ccan] / ccan / failtest / failtest.c
index 598a9e7930e933873ffbd9d02a3578d12d752472..4f71a63dc172896928cde965277b145093c13869 100644 (file)
@@ -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)) {