X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=test%2Ftest.cc;h=b6e017acdb3a4a4a5fefbb16db61500f2a945393;hp=50770a6875ce2e2f05f9685f2319eb2fdc651d40;hb=8fcd1dc3bdec69d4aa7bc76926993733952a10be;hpb=48b82de5b6e8e07330a2f72dbddd8d9830fe047e diff --git a/test/test.cc b/test/test.cc index 50770a687..b6e017acd 100644 --- a/test/test.cc +++ b/test/test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2018 Carl Hetherington + Copyright (C) 2012-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -35,6 +35,8 @@ #include "lib/dcp_content_type.h" #include "lib/log_entry.h" #include "lib/compose.hpp" +#include "lib/file_log.h" +#include "lib/dcpomatic_log.h" #include "test.h" #include #include @@ -69,12 +71,13 @@ using boost::shared_ptr; using boost::scoped_array; using boost::dynamic_pointer_cast; -boost::filesystem::path private_data = boost::filesystem::canonical(boost::filesystem::path ("..") / boost::filesystem::path ("dcpomatic-test-private")); +boost::filesystem::path TestPaths::TestPaths::private_data = boost::filesystem::canonical(boost::filesystem::path ("..") / boost::filesystem::path ("dcpomatic-test-private")); +boost::filesystem::path TestPaths::xsd = boost::filesystem::canonical(boost::filesystem::path("..") / boost::filesystem::path("libdcp") / boost::filesystem::path("xsd")); void setup_test_config () { - Config::instance()->set_master_encoding_threads (1); + Config::instance()->set_master_encoding_threads (boost::thread::hardware_concurrency()); Config::instance()->set_server_encoding_threads (1); Config::instance()->set_server_port_base (61921); Config::instance()->set_default_isdcf_metadata (ISDCFMetadata ()); @@ -111,8 +114,10 @@ struct TestConfig char* env_private = getenv("DCPOMATIC_TEST_PRIVATE"); if (env_private) { - private_data = env_private; + TestPaths::TestPaths::private_data = env_private; } + + dcpomatic_log.reset (new FileLog("build/test/log")); } ~TestConfig () @@ -292,6 +297,14 @@ note (dcp::NoteType t, string n) } } + +void +check_dcp (boost::filesystem::path ref, shared_ptr film) +{ + check_dcp (ref, film->dir(film->dcp_name())); +} + + void check_dcp (boost::filesystem::path ref, boost::filesystem::path check) { @@ -385,7 +398,7 @@ wait_for_jobs () JobManager* jm = JobManager::instance (); while (jm->work_to_do ()) { while (signal_manager->ui_idle ()) {} - dcpomatic_sleep (1); + dcpomatic_sleep_seconds (1); } if (jm->errors ()) { @@ -417,11 +430,11 @@ wait_for_jobs () } void -write_image (shared_ptr image, boost::filesystem::path file, string format) +write_image (shared_ptr image, boost::filesystem::path file, string format, MagickCore::StorageType pixel_type) { using namespace MagickCore; - Magick::Image m (image->size().width, image->size().height, format.c_str(), CharPixel, (void *) image->data()[0]); + Magick::Image m (image->size().width, image->size().height, format.c_str(), pixel_type, (void *) image->data()[0]); m.write (file.string ()); }