Run all tests with lots of encoding threads.
[dcpomatic.git] / test / test.cc
index 836e74f52753a66f525b92e291cb4eb7cd8c11a4..b6e017acdb3a4a4a5fefbb16db61500f2a945393 100644 (file)
@@ -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 <dcp/dcp.h>
 #include <dcp/cpl.h>
@@ -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<const Film> film)
+{
+       check_dcp (ref, film->dir(film->dcp_name()));
+}
+
+
 void
 check_dcp (boost::filesystem::path ref, boost::filesystem::path check)
 {