X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ftest.cc;h=06ec23dbcb6c4daadd5399cba6058fcb87197ed4;hb=3a1ddb9e182be28a22c5bbc85c06ee6629b72fe6;hp=90b40ed25b1b925af82d857beccb81022d3e00e3;hpb=e21a8bc77f80374a78085c492e4dd14315457e5f;p=dcpomatic.git diff --git a/test/test.cc b/test/test.cc index 90b40ed25..06ec23dbc 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); } @@ -126,6 +132,7 @@ setup_test_config () auto decryption = make_shared(dcp::file_to_string("test/data/decryption_chain")); decryption->set_key(dcp::file_to_string("test/data/decryption_key")); Config::instance()->set_decryption_chain (decryption); + Config::instance()->set_dcp_asset_filename_format(dcp::NameFormat("%t")); } @@ -931,12 +938,9 @@ void progress (float) {} void -make_and_verify_dcp (shared_ptr film, vector ignore) +verify_dcp(boost::filesystem::path dir, vector ignore) { - film->write_metadata (); - make_dcp (film, TranscodeJob::ChangedBehaviour::IGNORE); - BOOST_REQUIRE (!wait_for_jobs()); - auto notes = dcp::verify ({film->dir(film->dcp_name())}, &stage, &progress, TestPaths::xsd()); + auto notes = dcp::verify({dir}, &stage, &progress, {}, TestPaths::xsd()); bool ok = true; for (auto i: notes) { if (find(ignore.begin(), ignore.end(), i.code()) == ignore.end()) { @@ -948,6 +952,16 @@ make_and_verify_dcp (shared_ptr film, vector } +void +make_and_verify_dcp (shared_ptr film, vector ignore) +{ + film->write_metadata (); + make_dcp (film, TranscodeJob::ChangedBehaviour::IGNORE); + BOOST_REQUIRE (!wait_for_jobs()); + verify_dcp({film->dir(film->dcp_name())}, ignore); +} + + void check_int_close (int a, int b, int d) {