From 61f9ca9f3c3fb8283ebc67c39f9083730511488b Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 29 Nov 2014 16:30:35 +0700 Subject: Use test utility function to find evoral test files either via EVORAL_TEST_PATH env var or on windows via directory relative to dll --- libs/evoral/test/SMFTest.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'libs/evoral/test/SMFTest.cpp') diff --git a/libs/evoral/test/SMFTest.cpp b/libs/evoral/test/SMFTest.cpp index 3c82b14f95..9bbe021947 100644 --- a/libs/evoral/test/SMFTest.cpp +++ b/libs/evoral/test/SMFTest.cpp @@ -21,11 +21,24 @@ SMFTest::createNewFileTest () CPPUNIT_ASSERT(Glib::file_test (new_file_path, Glib::FILE_TEST_IS_REGULAR)); } +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"); +#endif +} + void SMFTest::takeFiveTest () { TestSMF smf; - smf.open("./test/testdata/TakeFive.mid"); + string testdata_path; + CPPUNIT_ASSERT (find_file (test_search_path (), "TakeFive.mid", testdata_path)); + smf.open(testdata_path); CPPUNIT_ASSERT(!smf.is_empty()); seq->start_write(); -- cgit v1.2.3