summaryrefslogtreecommitdiff
path: root/test/test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-10-04 22:04:40 +0200
committerCarl Hetherington <cth@carlh.net>2020-10-13 18:51:11 +0200
commit5d937606cf96d163be98920fa5619114a28eec9d (patch)
tree8e36025e51f2eaa9476de4c48810126a2f071127 /test/test.cc
parent7b302908e4b6186c44fd3a97aa4ba0716fb8674f (diff)
Fix use of DCPOMATIC_TEST_PRIVATE variable to specify where
test private data is.
Diffstat (limited to 'test/test.cc')
-rw-r--r--test/test.cc25
1 files changed, 18 insertions, 7 deletions
diff --git a/test/test.cc b/test/test.cc
index 5aee44230..a576ee0c0 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -72,8 +72,24 @@ using boost::shared_ptr;
using boost::scoped_array;
using boost::dynamic_pointer_cast;
-boost::filesystem::path TestPaths::TestPaths::private_data = boost::filesystem::canonical(boost::filesystem::path ("..") / boost::filesystem::path ("dcpomatic-test-private"));
-boost::filesystem::path TestPaths::xsd = boost::filesystem::canonical(boost::filesystem::path("..") / boost::filesystem::path("libdcp") / boost::filesystem::path("xsd"));
+
+boost::filesystem::path
+TestPaths::TestPaths::private_data ()
+{
+ char* env = getenv("DCPOMATIC_TEST_PRIVATE");
+ if (env) {
+ return boost::filesystem::path(env);
+ }
+
+ return boost::filesystem::canonical(boost::filesystem::path ("..") / boost::filesystem::path ("dcpomatic-test-private"));
+}
+
+
+boost::filesystem::path TestPaths::xsd ()
+{
+ return boost::filesystem::canonical(boost::filesystem::path("..") / boost::filesystem::path("libdcp") / boost::filesystem::path("xsd"));
+}
+
void
setup_test_config ()
@@ -118,11 +134,6 @@ struct TestConfig
signal_manager = new TestSignalManager ();
- char* env_private = getenv("DCPOMATIC_TEST_PRIVATE");
- if (env_private) {
- TestPaths::TestPaths::private_data = env_private;
- }
-
dcpomatic_log.reset (new FileLog("build/test/log"));
}