summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-03-21 12:24:20 +0100
committerCarl Hetherington <cth@carlh.net>2023-03-22 23:37:51 +0100
commit4063260e52dafe5a75a321ff273dba182fd2f6a9 (patch)
tree5c642a3110c5240451871df63e5c54179dcdb3e6
parentae01c1e979463e4d1acd22b1eb9074e800c41ea4 (diff)
Don't crash immediately if there's no private data.
-rw-r--r--test/test.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test.cc b/test/test.cc
index 9d444e5cb..c91701e55 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -94,7 +94,13 @@ TestPaths::TestPaths::private_data ()
return boost::filesystem::path(env);
}
- return boost::filesystem::canonical(boost::filesystem::path ("..") / boost::filesystem::path ("dcpomatic-test-private"));
+ auto relative = boost::filesystem::path ("..") / boost::filesystem::path ("dcpomatic-test-private");
+ if (!boost::filesystem::exists(relative)) {
+ std::cerr << "No private test data found! Tests may fail.\n";
+ return relative;
+ }
+
+ return boost::filesystem::canonical(relative);
}