Make sure gdb is installed for tests.
[m6w6/libmemcached] / libtest / unittest.cc
index 9945e38690451906f56776d4b522a1a62e86e019..7f0c7404fc2d5ca74997efaf1dc3a0bfcb281809 100644 (file)
@@ -324,6 +324,7 @@ static test_return_t application_true_BINARY(void *)
 
 static test_return_t application_gdb_true_BINARY2(void *)
 {
+  test_skip(0, access("/usr/bin/gdb", X_OK ));
   Application true_app("true");
   true_app.use_gdb();
 
@@ -335,6 +336,7 @@ static test_return_t application_gdb_true_BINARY2(void *)
 
 static test_return_t application_gdb_true_BINARY(void *)
 {
+  test_skip(0, access("/usr/bin/gdb", X_OK ));
   Application true_app("true");
   true_app.use_gdb();
 
@@ -362,7 +364,11 @@ static test_return_t application_doesnotexist_BINARY(void *)
   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"))
   {
@@ -370,7 +376,11 @@ static test_return_t application_doesnotexist_BINARY(void *)
   }
   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());
 
@@ -547,6 +557,7 @@ static test_return_t wait_services_BINARY2(void *)
 
 static test_return_t wait_services_appliction_TEST(void *)
 {
+  test_skip(0, access("/usr/bin/gdb", X_OK ));
   test_skip(0, access("/etc/services", R_OK ));
 
   libtest::Application wait_app("libtest/wait", true);
@@ -561,6 +572,11 @@ static test_return_t wait_services_appliction_TEST(void *)
 
 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("/usr/bin/gdb", X_OK ));
   test_skip(0, access("/etc/services", R_OK ));
 
   libtest::Application wait_app("libtest/wait", true);
@@ -575,6 +591,12 @@ static test_return_t gdb_wait_services_appliction_TEST(void *)
 
 static test_return_t gdb_abort_services_appliction_TEST(void *)
 {
+  test_skip(0, access("/usr/bin/gdb", X_OK ));
+
+#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();