From f498f903f70b7b80fe62ff3fb4da4a342758eb47 Mon Sep 17 00:00:00 2001
From: Leorize <alaviss@users.noreply.github.com>
Date: Sun, 31 Dec 2017 10:22:49 +0700
Subject: add Haiku support


diff --git a/atf-c++/check_test.cpp b/atf-c++/check_test.cpp
index 7baf3fa..aa9b9b6 100644
--- a/atf-c++/check_test.cpp
+++ b/atf-c++/check_test.cpp
@@ -292,7 +292,11 @@ ATF_TEST_CASE_BODY(exec_exitstatus)
             do_exec(this, "exit-signal");
         ATF_REQUIRE(!r->exited());
         ATF_REQUIRE(r->signaled());
+#if defined(__HAIKU__)
+        ATF_REQUIRE_EQ(r->termsig(), SIGKILLTHR);
+#else
         ATF_REQUIRE_EQ(r->termsig(), SIGKILL);
+#endif
     }
 }
 
diff --git a/atf-c++/detail/fs.cpp b/atf-c++/detail/fs.cpp
index bcef920..3476608 100644
--- a/atf-c++/detail/fs.cpp
+++ b/atf-c++/detail/fs.cpp
@@ -32,7 +32,9 @@
 extern "C" {
 #include <sys/param.h>
 #include <sys/types.h>
+#ifndef __HAIKU__
 #include <sys/mount.h>
+#endif
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <dirent.h>
diff --git a/atf-c/check_test.c b/atf-c/check_test.c
index adaca64..b84337f 100644
--- a/atf-c/check_test.c
+++ b/atf-c/check_test.c
@@ -385,7 +385,11 @@ ATF_TC_BODY(exec_exitstatus, tc)
         do_exec(tc, "exit-signal", &result);
         ATF_CHECK(!atf_check_result_exited(&result));
         ATF_CHECK(atf_check_result_signaled(&result));
+#if defined(__HAIKU__)
+        ATF_CHECK(atf_check_result_termsig(&result) == SIGKILLTHR);
+#else
         ATF_CHECK(atf_check_result_termsig(&result) == SIGKILL);
+#endif
         atf_check_result_fini(&result);
     }
 }
diff --git a/atf-c/detail/fs.c b/atf-c/detail/fs.c
index 5ff7648..4740bbd 100644
--- a/atf-c/detail/fs.c
+++ b/atf-c/detail/fs.c
@@ -31,7 +31,9 @@
 
 #include <sys/types.h>
 #include <sys/param.h>
+#ifndef __HAIKU__
 #include <sys/mount.h>
+#endif
 #include <sys/stat.h>
 #include <sys/wait.h>
 
diff --git a/atf-c/detail/process_test.c b/atf-c/detail/process_test.c
index 5ae5565..9ce030b 100644
--- a/atf-c/detail/process_test.c
+++ b/atf-c/detail/process_test.c
@@ -635,7 +635,11 @@ ATF_TC_BODY(status_signaled, tc)
         RE(atf_process_status_init(&s, rawstatus));
         ATF_CHECK(!atf_process_status_exited(&s));
         ATF_CHECK(atf_process_status_signaled(&s));
+#if defined(__HAIKU__)
+        ATF_CHECK_EQ(atf_process_status_termsig(&s), SIGKILLTHR);
+#else
         ATF_CHECK_EQ(atf_process_status_termsig(&s), SIGKILL);
+#endif
         ATF_CHECK(!atf_process_status_coredump(&s));
         atf_process_status_fini(&s);
     }
-- 
2.15.0


From 26850579ebf31b997bbdd3ea2b29db0b85a78494 Mon Sep 17 00:00:00 2001
From: Leorize <alaviss@users.noreply.github.com>
Date: Fri, 5 Jan 2018 20:38:11 +0700
Subject: tests: disable tests that requires atf installed


diff --git a/Kyuafile b/Kyuafile
index a65bb53..d85251d 100644
--- a/Kyuafile
+++ b/Kyuafile
@@ -4,5 +4,3 @@ test_suite("atf")
 
 include("atf-c/Kyuafile")
 include("atf-c++/Kyuafile")
-include("atf-sh/Kyuafile")
-include("test-programs/Kyuafile")
diff --git a/atf-c++/Kyuafile b/atf-c++/Kyuafile
index 9fd43af..5de8481 100644
--- a/atf-c++/Kyuafile
+++ b/atf-c++/Kyuafile
@@ -6,7 +6,6 @@ atf_test_program{name="atf_c++_test"}
 atf_test_program{name="build_test"}
 atf_test_program{name="check_test"}
 atf_test_program{name="macros_test"}
-atf_test_program{name="pkg_config_test"}
 atf_test_program{name="tests_test"}
 atf_test_program{name="utils_test"}
 
diff --git a/atf-c/Kyuafile b/atf-c/Kyuafile
index 40fdb92..fa471c9 100644
--- a/atf-c/Kyuafile
+++ b/atf-c/Kyuafile
@@ -7,7 +7,6 @@ atf_test_program{name="build_test"}
 atf_test_program{name="check_test"}
 atf_test_program{name="error_test"}
 atf_test_program{name="macros_test"}
-atf_test_program{name="pkg_config_test"}
 atf_test_program{name="tc_test"}
 atf_test_program{name="tp_test"}
 atf_test_program{name="utils_test"}
-- 
2.15.0

