# We only build tests on Ubuntu 18.04
cmd += ' --disable-tests'
elif target.platform == 'windows':
- cmd += f' --target-windows-{target.bits} --disable-tests'
+ cmd += f' --target-windows-{target.bits}'
if target.version == 'xp':
# OpenJPEG 1.x is inexplicably faster on Windows XP; see DCP-o-matic bug #771
cmd += ' --jpeg=oj1'
return os.path.abspath('build/doc/html')
def test(target, test):
- if target.platform != 'windows':
- target.set('LC_ALL', 'C')
- if test is None:
- target.command('run/tests')
- else:
- target.command('run/tests --run_test=%s' % test)
+ target.set('LC_ALL', 'C')
+ cmd = 'run\\tests ' if target.platform == 'windows' else 'run/tests '
+ if test is not None:
+ cmd += '-t %s' % test
+ target.command(cmd)
+
--- /dev/null
+set PATH=%PATH%;c:\users\ci\bin;c:\users\ci\workspace\libdcp\bin;c:\users\ci\workspace\libdcp\lib
+xcopy ..\libdcp\tags build\tags\
+xcopy ..\libdcp\ratings build\
+build\test\tests.exe --log_level=test_suite -- c:\users\ci\libdcp-test-private
using std::make_shared;
static void
-check (shared_ptr<dcp::ReelMonoPictureAsset> pa, dcp::Fraction far, string sar)
+check (shared_ptr<dcp::ReelMonoPictureAsset> pa, dcp::Fraction frac, string sar)
{
- pa->set_screen_aspect_ratio (far);
+ pa->set_screen_aspect_ratio (frac);
xmlpp::Document doc;
auto el = doc.create_root_node ("Test");
pa->write_to_cpl (el, dcp::Standard::INTEROP);
#include <boost/scoped_array.hpp>
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif
+
+
using std::dynamic_pointer_cast;
using std::make_pair;
using std::make_shared;
int r = system (
"xmllint --path schema --nonet --noout --schema schema/SMPTE-430-1-2006-Amd-1-2009-KDM.xsd build/test/encryption_test.kdm.xml "
+#ifndef LIBDCP_WINDOWS
"> build/test/xmllint.log 2>&1 < /dev/null"
+#endif
);
#ifdef LIBDCP_WINDOWS
BOOST_CHECK_EQUAL (r, 0);
#else
- BOOST_CHECK_EQUAL (WEXITSTATUS (r), 0);
+ BOOST_CHECK_EQUAL (WEXITSTATUS(r), 0);
#endif
r = system ("xmlsec1 verify "
"--trusted-pem test/ref/crypt/intermediate.signed.pem "
"--trusted-pem test/ref/crypt/ca.self-signed.pem "
"--id-attr:Id http://www.smpte-ra.org/schemas/430-3/2006/ETM:AuthenticatedPublic "
- "--id-attr:Id http://www.smpte-ra.org/schemas/430-3/2006/ETM:AuthenticatedPrivate "
- "build/test/encryption_test.kdm.xml > build/test/xmlsec1.log 2>&1 < /dev/null");
+ "--id-attr:Id http://www.smpte-ra.org/schemas/430-3/2006/ETM:AuthenticatedPrivate --crypto openssl "
+ "build/test/encryption_test.kdm.xml "
+#ifndef LIBDCP_WINDOWS
+ "> build/test/xmlsec1.log 2>&1 < /dev/null"
+#endif
+ );
#ifdef LIBDCP_WINDOWS
BOOST_CHECK_EQUAL (r, 0);
using std::make_shared;
static void
-check (unsigned int* seed, shared_ptr<dcp::PictureAssetWriter> writer, string hash)
+check (shared_ptr<dcp::PictureAssetWriter> writer, string hash)
{
shared_ptr<dcp::OpenJPEGImage> xyz (new dcp::OpenJPEGImage (dcp::Size (1998, 1080)));
for (int c = 0; c < 3; ++c) {
for (int p = 0; p < (1998 * 1080); ++p) {
- xyz->data(c)[p] = rand_r (seed) & 0xfff;
+ xyz->data(c)[p] = rand() & 0xfff;
}
}
BOOST_CHECK_EQUAL (info.hash, hash);
}
+
/** Test the hashing of data written to JPEG2000 MXFs with some random inputs */
BOOST_AUTO_TEST_CASE (frame_info_hash_test)
{
auto mp = make_shared<dcp::MonoPictureAsset>(dcp::Fraction (24, 1), dcp::Standard::SMPTE);
auto writer = mp->start_write ("build/test/frame_info_hash_test.mxf", false);
- unsigned int seed = 42;
+ srand(42);
/* Check a few random frames */
- check (&seed, writer, "9da3d1d93a80683e65d996edae4101ed");
- check (&seed, writer, "ecd77b3fbf459591f24119d4118783fb");
- check (&seed, writer, "9f10303495b58ccb715c893d40127e22");
+ check (writer, "9da3d1d93a80683e65d996edae4101ed");
+ check (writer, "ecd77b3fbf459591f24119d4118783fb");
+ check (writer, "9f10303495b58ccb715c893d40127e22");
}
auto xml_id = dcp::make_uuid ();
ASDCP::TimedText::MXFWriter writer;
auto subs_mxf = dir / "subs.mxf";
- auto r = writer.OpenWrite(subs_mxf.c_str(), writer_info, descriptor, 4096);
+ auto r = writer.OpenWrite(subs_mxf.string().c_str(), writer_info, descriptor, 4096);
BOOST_REQUIRE (ASDCP_SUCCESS(r));
writer.WriteTimedTextResource (dcp::String::compose(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
auto xml_id = resource_id;
ASDCP::TimedText::MXFWriter writer;
auto subs_mxf = dir / "subs.mxf";
- auto r = writer.OpenWrite(subs_mxf.c_str(), writer_info, descriptor, 4096);
+ auto r = writer.OpenWrite(subs_mxf.string().c_str(), writer_info, descriptor, 4096);
BOOST_REQUIRE (ASDCP_SUCCESS(r));
writer.WriteTimedTextResource (dcp::String::compose(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"