summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-09-13 15:30:00 +0200
committerRobin Gareus <robin@gareus.org>2015-09-13 15:30:00 +0200
commit8e8f8d92c2e49804af80cd42145bea728b9c7fd0 (patch)
tree1b84876ddf0adf3323a9aa1a81e4cf9628f944d0
parentaabc5108f34058d466d1e7451694193a08379ce2 (diff)
allow to run unit-test under wine from srcdir.
-rw-r--r--libs/ardour/test/test_util.cc9
-rw-r--r--libs/evoral/test/SMFTest.cpp9
-rw-r--r--libs/midi++2/test/MidnamTest.cpp17
-rw-r--r--libs/pbd/test/test_common.cc9
4 files changed, 24 insertions, 20 deletions
diff --git a/libs/ardour/test/test_util.cc b/libs/ardour/test/test_util.cc
index 045b916aff..7be501d100 100644
--- a/libs/ardour/test/test_util.cc
+++ b/libs/ardour/test/test_util.cc
@@ -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
diff --git a/libs/evoral/test/SMFTest.cpp b/libs/evoral/test/SMFTest.cpp
index d42ee26dff..0907cdc2f5 100644
--- a/libs/evoral/test/SMFTest.cpp
+++ b/libs/evoral/test/SMFTest.cpp
@@ -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
diff --git a/libs/midi++2/test/MidnamTest.cpp b/libs/midi++2/test/MidnamTest.cpp
index 03d0682c8d..4a0d85801e 100644
--- a/libs/midi++2/test/MidnamTest.cpp
+++ b/libs/midi++2/test/MidnamTest.cpp
@@ -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
diff --git a/libs/pbd/test/test_common.cc b/libs/pbd/test/test_common.cc
index f9bc42c027..12bab8baa8 100644
--- a/libs/pbd/test/test_common.cc
+++ b/libs/pbd/test/test_common.cc
@@ -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