setup_test_config ();
capture_ffmpeg_logs();
- EncodeServerFinder::instance()->stop ();
+ EncodeServerFinder::drop();
signal_manager = new TestSignalManager ();
dcpomatic_log.reset (new FileLog("build/test/log"));
+
+ auto const& suite = boost::unit_test::framework::master_test_suite();
+ int types = LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR;
+ for (int i = 1; i < suite.argc; ++i) {
+ if (string(suite.argv[i]) == "--log=debug-player") {
+ types |= LogEntry::TYPE_DEBUG_PLAYER;
+ }
+ }
+
+ dcpomatic_log->set_types(types);
}
~TestConfig ()
}
void
-check_xml (xmlpp::Element* ref, xmlpp::Element* test, list<string> ignore)
+check_xml(xmlpp::Element* ref, xmlpp::Element* test, list<Glib::ustring> ignore)
{
BOOST_CHECK_EQUAL (ref->get_name (), test->get_name ());
BOOST_CHECK_EQUAL (ref->get_namespace_prefix (), test->get_namespace_prefix ());
}
void
-check_xml (boost::filesystem::path ref, boost::filesystem::path test, list<string> ignore)
+check_xml(boost::filesystem::path ref, boost::filesystem::path test, list<Glib::ustring> ignore)
{
auto ref_parser = new xmlpp::DomParser(ref.string());
auto ref_root = ref_parser->get_document()->get_root_node();
auto asset = dynamic_pointer_cast<dcp::MonoPictureAsset> (dcp.cpls().front()->reels().front()->main_picture()->asset());
BOOST_REQUIRE (asset);
auto frame = asset->start_read()->get_frame(index);
- auto ref_frame (new dcp::MonoPictureFrame (ref));
+ dcp::MonoPictureFrame ref_frame(ref);
auto image = frame->xyz_image ();
- auto ref_image = ref_frame->xyz_image ();
+ auto ref_image = ref_frame.xyz_image();
BOOST_REQUIRE (image->size() == ref_image->size());
int off = 0;
for (int y = 0; y < ref_image->size().height; ++y) {
for (int x = 0; x < ref_image->size().width; ++x) {
- BOOST_REQUIRE_EQUAL (ref_image->data(0)[off], image->data(0)[off]);
- BOOST_REQUIRE_EQUAL (ref_image->data(1)[off], image->data(1)[off]);
- BOOST_REQUIRE_EQUAL (ref_image->data(2)[off], image->data(2)[off]);
+ auto x_error = std::abs(ref_image->data(0)[off] - image->data(0)[off]);
+ BOOST_REQUIRE_MESSAGE(x_error == 0, "x component at " << x << "," << y << " differs by " << x_error);
+ auto y_error = std::abs(ref_image->data(1)[off] - image->data(1)[off]);
+ BOOST_REQUIRE_MESSAGE(y_error == 0, "y component at " << x << "," << y << " differs by " << y_error);
+ auto z_error = std::abs(ref_image->data(2)[off] - image->data(2)[off]);
+ BOOST_REQUIRE_MESSAGE(z_error == 0, "z component at " << x << "," << y << " differs by " << z_error);
++off;
}
}
void
#ifdef DCPOMATIC_LINUX
-make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool dcp_inspect)
+make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool dcp_inspect, bool clairmeta)
#else
-make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool)
+make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool, bool)
#endif
{
film->write_metadata ();
auto result = system(cmd.c_str());
BOOST_CHECK_EQUAL(WEXITSTATUS(result), 0);
}
+
+ if (clairmeta && getenv("DCPOMATIC_CLAIRMETA")) {
+ auto cmd = String::compose("python3 -m clairmeta.cli check -type dcp %1 > %2 2>&1", film->dir(film->dcp_name()), film->file("clairmeta.log"));
+ auto result = system(cmd.c_str());
+ BOOST_CHECK_EQUAL(WEXITSTATUS(result), 0);
+ }
#endif
}