#include <unistd.h>
+#if defined(HAVE_SYS_SYSCTL_H) && HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+
namespace libtest {
size_t number_of_cpus()
{
size_t number_of_cpu= 1;
-#ifdef TARGET_OS_LINUX
+#if TARGET_OS_LINUX
number_of_cpu= sysconf(_SC_NPROCESSORS_ONLN);
#elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) && defined(HW_AVAILCPU) && defined(HW_NCPU)
int mib[4];
number_of_cpu = 1;
}
}
+#else
+ fprintf(stderr, "Going with guessing\n");
#endif
return number_of_cpu;
Application true_app("doesnotexist");
const char *args[]= { "--fubar", 0 };
+#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
+ test_compare(Application::INVALID, true_app.run(args));
+#else
test_compare(Application::SUCCESS, true_app.run(args));
+#endif
// Behavior is different if we are running under valgrind
if (getenv("TESTS_ENVIRONMENT") and strstr(getenv("TESTS_ENVIRONMENT"), "valgrind"))
{
}
else
{
+#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
+ test_compare(Application::FAILURE, true_app.wait());
+#else
test_compare(Application::INVALID, true_app.wait());
+#endif
}
test_compare(0, true_app.stdout_result().size());
static test_return_t gdb_wait_services_appliction_TEST(void *)
{
+#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
+ test_skip(0, TARGET_OS_OSX);
+#endif
+
test_skip(0, access("/etc/services", R_OK ));
libtest::Application wait_app("libtest/wait", true);
static test_return_t gdb_abort_services_appliction_TEST(void *)
{
+#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
+ test_skip(0, TARGET_OS_OSX);
+#endif
+
libtest::Application abort_app("libtest/abort", true);
abort_app.use_gdb();