allow to run unit-test under wine from srcdir.
authorRobin Gareus <robin@gareus.org>
Sun, 13 Sep 2015 13:30:00 +0000 (15:30 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 13 Sep 2015 13:30:00 +0000 (15:30 +0200)
libs/ardour/test/test_util.cc
libs/evoral/test/SMFTest.cpp
libs/midi++2/test/MidnamTest.cpp
libs/pbd/test/test_common.cc

index 045b916aff10ae8fab5714da5937f82564100340..7be501d1004a9801a815d7921ec0e6d76df7cc3c 100644 (file)
@@ -134,11 +134,12 @@ PBD::Searchpath
 test_search_path ()
 {
 #ifdef PLATFORM_WINDOWS
-       std::string wsp(windows_package_directory_path());
-       return Glib::build_filename (wsp, "ardour_testdata");
-#else
-       return Glib::getenv("ARDOUR_TEST_PATH");
+       if (!getenv("ARDOUR_TEST_PATH")) {
+               std::string wsp(windows_package_directory_path());
+               return Glib::build_filename (wsp, "ardour_testdata");
+       }
 #endif
+       return Glib::getenv("ARDOUR_TEST_PATH");
 }
 
 std::string
index d42ee26dff2f707187147299fd87597c19454fe8..0907cdc2f547aa1be8b6f373da6f644c46e2a812 100644 (file)
@@ -25,11 +25,12 @@ PBD::Searchpath
 test_search_path ()
 {
 #ifdef PLATFORM_WINDOWS
-       string wsp(g_win32_get_package_installation_directory_of_module(NULL));
-       return Glib::build_filename (wsp,  "evoral_testdata");
-#else
-       return Glib::getenv("EVORAL_TEST_PATH");
+       if (!getenv("EVORAL_TEST_PATH")) {
+               string wsp(g_win32_get_package_installation_directory_of_module(NULL));
+               return Glib::build_filename (wsp,  "evoral_testdata");
+       }
 #endif
+       return Glib::getenv("EVORAL_TEST_PATH");
 }
 
 void
index 03d0682c8dafe699b87586e47d373dd1a009068a..4a0d85801ee098ec100b19f6cc1e2c4bc910677b 100644 (file)
@@ -18,15 +18,16 @@ PBD::Searchpath
 test_search_path ()
 {
 #ifdef PLATFORM_WINDOWS
-       std::vector<std::string> path_tok;
-       path_tok.push_back (g_win32_get_package_installation_directory_of_module(NULL));
-       path_tok.push_back ("share");
-       path_tok.push_back ("ardour3");
-       path_tok.push_back ("patchfiles");
-       return Glib::build_filename (path_tok);
-#else
-       return Glib::getenv("MIDIPP_TEST_PATH");
+       if (!getenv("MIDIPP_TEST_PATH")) {
+               std::vector<std::string> path_tok;
+               path_tok.push_back (g_win32_get_package_installation_directory_of_module(NULL));
+               path_tok.push_back ("share");
+               path_tok.push_back ("ardour3");
+               path_tok.push_back ("patchfiles");
+               return Glib::build_filename (path_tok);
+       }
 #endif
+       return Glib::getenv("MIDIPP_TEST_PATH");
 }
 
 void
index f9bc42c02761fabc10a9dde275344e7d8dbbddf1..12bab8baa8b5440a22cb9d5cd5caef77c67e614f 100644 (file)
@@ -36,11 +36,12 @@ PBD::Searchpath
 test_search_path ()
 {
 #ifdef PLATFORM_WINDOWS
-       std::string wsp(g_win32_get_package_installation_directory_of_module(NULL));
-       return Glib::build_filename (wsp,  "pbd_testdata");
-#else
-       return Glib::getenv("PBD_TEST_PATH");
+       if (!getenv("PBD_TEST_PATH")) {
+               std::string wsp(g_win32_get_package_installation_directory_of_module(NULL));
+               return Glib::build_filename (wsp,  "pbd_testdata");
+       }
 #endif
+       return Glib::getenv("PBD_TEST_PATH");
 }
 
 std::string