Stop using OSv-specific features (namely debug()) in this test, so we
can also run it on Linux.

This test currently hangs on Linux, because the test assumes that signal()
sets system calls to not restart - while on Linux, they do.

Signed-off-by: Nadav Har'El <[email protected]>
---
 tests/tst-kill.cc | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/tst-kill.cc b/tests/tst-kill.cc
index 249ff53..912cdd7 100644
--- a/tests/tst-kill.cc
+++ b/tests/tst-kill.cc
@@ -10,8 +10,9 @@
 #include <sys/types.h>
 #include <signal.h>
 #include <sys/socket.h>
-
-#include <osv/debug.hh>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
 
 int tests = 0, fails = 0;
 
@@ -19,13 +20,13 @@ static void report(bool ok, const char* msg)
 {
     ++tests;
     fails += !ok;
-    debug("%s: %s\n", (ok ? "PASS" : "FAIL"), msg);
+    printf("%s: %s\n", (ok ? "PASS" : "FAIL"), msg);
 }
 
 int global = 0;
 
 void handler1(int sig) {
-    debug("handler1 called, sig=%d\n", sig);
+    printf("handler1 called, sig=%d, global=%d\n", sig, global);
     global = 1;
 }
 
@@ -143,12 +144,14 @@ int main(int ac, char** av)
     report(r == 0 && oldact.sa_handler == SIG_DFL, "with SA_RESETHAND, signal 
handler is reset");
 
 
-    debug("SUMMARY: %d tests, %d failures\n", tests, fails);
+    printf("SUMMARY: %d tests, %d failures\n", tests, fails);
 
     // At this point, handler1 might still be running, and if we return this
     // module, including handler1, might be unmapped. So sleep to make sure
     // that handler1 is done.
     sleep(1);
+
+    return fails == 0 ? 0 : 1;
 }
 
 
-- 
2.9.3

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to