From: Carl Hetherington Date: Tue, 21 Mar 2023 11:24:20 +0000 (+0100) Subject: Don't crash immediately if there's no private data. X-Git-Tag: v2.16.49~4 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=4063260e52dafe5a75a321ff273dba182fd2f6a9 Don't crash immediately if there's no private data. --- 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); }