chiark / gitweb /
Merge the Disobedience rewrite.
[disorder] / libtests / test.h
index 8af85d515c5fead40b1d624d28a58adde1ec431a..48c8956ca1aa175f2561ba9612ee3ffec1b9b476 100644 (file)
@@ -30,7 +30,6 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <signal.h>
-#include <sys/wait.h>
 #include <stddef.h>
 #include <sys/socket.h>
 #include <netdb.h>
@@ -69,6 +68,7 @@
 extern long long tests, errors;
 extern int fail_first;
 extern int verbose;
+extern int skipped;
 
 /** @brief Checks that @p expr is nonzero */
 #define insist(expr) do {                              \
@@ -154,7 +154,11 @@ void test_exitfn(int) attribute((noreturn));
     if(errors || verbose)                                               \
       fprintf(stderr, "test_"#name": %lld errors out of %lld tests\n",  \
               errors, tests);                                           \
-    return !!errors;                                                    \
+    if(errors)                                                          \
+      return 1;                                                         \
+    if(skipped)                                                         \
+      return 77;                                                        \
+    return 0;                                                           \
   }                                                                     \
                                                                         \
   struct swallow_semicolon