chiark / gitweb /
fatal() testing for dateparse()
[disorder] / libtests / test.c
index f5dd036d443eff8581549c539b8b6ab4e38e592a..d37d70fa78a41212e9b99ab49a3701ed825659a4 100644 (file)
@@ -93,6 +93,13 @@ const char *do_printf(const char *fmt, ...) {
   return s;
 }
 
   return s;
 }
 
+jmp_buf fatal_env;
+
+void test_exitfn(int rc) {
+  assert(rc != 0);
+  longjmp(fatal_env, rc);
+}
+
 static const struct option options[] = {
   { "verbose", no_argument, 0, 'v' },
   { "fail-first", no_argument, 0, 'F' },
 static const struct option options[] = {
   { "verbose", no_argument, 0, 'v' },
   { "fail-first", no_argument, 0, 'F' },