diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-03-21 12:24:20 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-03-22 23:37:51 +0100 |
| commit | 4063260e52dafe5a75a321ff273dba182fd2f6a9 (patch) | |
| tree | 5c642a3110c5240451871df63e5c54179dcdb3e6 | |
| parent | ae01c1e979463e4d1acd22b1eb9074e800c41ea4 (diff) | |
Don't crash immediately if there's no private data.
| -rw-r--r-- | test/test.cc | 8 |
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); } |
