Torok Edwin (strsignal and build fixes)
Roland Illig (varargs and strsignal portability fixes)
Daniel Gollub (pthreads support)
+ Friedrich Beckmann (mingw and msvc port)
Anybody who has contributed code to Check or Check's build system is
considered an author. Send patches to this file to
int n;
SRunner *sr;
+#ifdef _POSIX_VERSION
fork_setup();
setup_fixture();
setup();
+#endif /* _POSIX_VERSION */
+
sr = srunner_create (make_master_suite());
srunner_add_suite(sr, make_list_suite());
srunner_add_suite(sr, make_msg_suite());
}
END_TEST
+/* the ppack probably means 'pipe' pack */
+#ifdef _POSIX_VERSION
START_TEST(test_ppack)
{
int filedes[2];
}
END_TEST
-
#define BIG_MSG_LEN 1037
START_TEST(test_ppack_big)
free (fmsg.msg);
}
END_TEST
+#endif /* _POSIX_VERSION */
Suite *make_pack_suite(void)
{
tcase_add_test (tc_core, test_pack_loc);
tcase_add_test (tc_core, test_pack_ctx);
tcase_add_test (tc_core, test_pack_len);
+#ifdef _POSIX_VERSION
tcase_add_test (tc_core, test_ppack);
tcase_add_test (tc_core, test_ppack_noctx);
tcase_add_test (tc_core, test_ppack_onlyctx);
tcase_add_test (tc_core, test_ppack_multictx);
tcase_add_test (tc_core, test_ppack_nofail);
+#endif /* _POSIX_VERSION */
suite_add_tcase (s, tc_limit);
tcase_add_test (tc_limit, test_pack_ctx_limit);
tcase_add_test (tc_limit, test_pack_fail_limit);
tcase_add_test (tc_limit, test_pack_loc_limit);
+#ifdef _POSIX_VERSION
tcase_add_test (tc_limit, test_ppack_big);
+#endif /* _POSIX_VERSION */
return s;
}
}
END_TEST
+#ifdef _POSIX_VERSION
START_TEST(test_fork1p_pass)
{
-#ifdef _POSIX_VERSION
pid_t pid;
if((pid = fork()) < 0) {
fail("Failed to fork new process");
} else if (pid > 0) {
-#endif /* _POSIX_VERSION */
fail_unless(1, NULL);
-#ifdef _POSIX_VERSION
kill(pid, SIGKILL);
} else {
for (;;) {
sleep(1);
}
}
-#endif /* _POSIX_VERSION */
}
END_TEST
START_TEST(test_fork1p_fail)
{
-#ifdef _POSIX_VERSION
pid_t pid;
if((pid = fork()) < 0) {
fail("Failed to fork new process");
} else if (pid > 0) {
-#endif /* _POSIX_VERSION */
fail("Expected fail");
-#ifdef _POSIX_VERSION
kill(pid, SIGKILL);
} else {
for (;;) {
sleep(1);
}
}
-#endif /* _POSIX_VERSION */
}
END_TEST
check_waitpid_and_exit(pid);
}
END_TEST
+#endif /* _POSIX_VERSION */
START_TEST(test_srunner)
{
tcase_add_test (tc_limit, test_null);
tcase_add_test (tc_limit, test_null_2);
+#ifdef _POSIX_VERSION
tcase_add_test (tc_messaging_and_fork, test_fork1p_pass);
tcase_add_test (tc_messaging_and_fork, test_fork1p_fail);
tcase_add_test (tc_messaging_and_fork, test_fork1c_pass);
tcase_add_test (tc_messaging_and_fork, test_fork1c_fail);
tcase_add_test (tc_messaging_and_fork, test_fork2_pass);
tcase_add_test (tc_messaging_and_fork, test_fork2_fail);
+#endif /* _POSIX_VERSION */
return s;
}