Split tests up.
authorCarl Hetherington <cth@carlh.net>
Wed, 25 Sep 2013 14:43:15 +0000 (15:43 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 25 Sep 2013 14:43:15 +0000 (15:43 +0100)
20 files changed:
src/signer.h
src/xml/kdm_smpte.h
test/certificates_test.cc
test/color_test.cc
test/dcp_test.cc
test/dcp_time_test.cc
test/decryption_test.cc
test/encryption_test.cc
test/error_test.cc
test/kdm_test.cc
test/lut_test.cc
test/read_dcp_test.cc
test/recovery_test.cc
test/subtitle_tests.cc
test/test.cc [new file with mode: 0644]
test/test.h [new file with mode: 0644]
test/tests.cc [deleted file]
test/utc_offset_to_string_test.cc
test/util_test.cc
test/wscript

index 5ae7cf510907753bdf03f0932c1d154836760613..efb8099bcbbd86b5f3402a4b41eedc1f5e44e905 100644 (file)
 #include <boost/filesystem.hpp>
 #include "certificates.h"
 
+namespace xmlpp {
+       class Element;
+       class Node;
+}
+
 namespace libdcp {
 
 class Signer
index e8e65e9851846399e255c42654dce8f4060ba62b..0139876f6a2844dc365dc768fc47ca040d407348 100644 (file)
@@ -37,6 +37,9 @@
 #include <boost/optional.hpp>
 #include <boost/filesystem.hpp>
 #include <libxml/parser.h>
+#include <libxml++/libxml++.h>
+#include <libcxml/cxml.h>
+#include "../exceptions.h"
 
 namespace libdcp {
 namespace xml {
index ba29549b345df9bc107a811fe280d5178f898228..0a66bc66fc26d6c91b50b7eea850a1de0e5915fa 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
+#include "certificates.h"
+
+using std::list;
+using boost::shared_ptr;
+
 BOOST_AUTO_TEST_CASE (certificates)
 {
        libdcp::CertificateChain c;
index cd66f09bf14684f41fd1c704215a7a62cb5e0747..30a96a0dd78369ac8403a747fbeb6e5882c73b0f 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
+
+#include "util.h"
+
 /* Check that libdcp::Color works */
 BOOST_AUTO_TEST_CASE (color)
 {
index d4207d5a357830cfb1d865bb317d955c1c740dfd..9d3b8171b2baffd6e5f318765350637135a92e9d 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
+#include "dcp.h"
+#include "metadata.h"
+#include "cpl.h"
+#include "picture_asset.h"
+#include "sound_asset.h"
+#include "reel.h"
+#include "test.h"
+#include "KM_util.h"
+
+using boost::shared_ptr;
+
 /* Test creation of a DCP from very simple inputs */
 BOOST_AUTO_TEST_CASE (dcp_test)
 {
index 35f569cf91d87ba8c5a5eae297927e65f9717218..d6952f8874fc2e9769a55f433c078bd33ca7a5cf 100644 (file)
@@ -17,6 +17,9 @@
 
 */
 
+#include <boost/test/unit_test.hpp>
+#include "dcp_time.h"
+
 /** Check that libdcp::Time works */
 BOOST_AUTO_TEST_CASE (dcp_time)
 {
index 253efac17e31d52cd46a9743e65c96f8ec35dc7a..73dc9b972537e9ef75039260e45dcb6dd03303db 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
 #include "kdm.h"
+#include "dcp.h"
 #include "picture_frame.h"
+#include "cpl.h"
 #include "argb_frame.h"
+#include "picture_asset.h"
+#include "reel.h"
+#include "test.h"
 
 using boost::dynamic_pointer_cast;
+using boost::shared_ptr;
 
 static shared_ptr<const libdcp::ARGBFrame>
 get_frame (libdcp::DCP const & dcp)
index 60177438fe1db3149d54d78de363874e7318deb6..82d5fe2798d9f1fe4976a3c3011b3d2f4d441d5e 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
 #include "kdm.h"
+#include "KM_util.h"
+#include "metadata.h"
+#include "certificates.h"
+#include "dcp.h"
+#include "signer.h"
+#include "cpl.h"
+#include "picture_asset.h"
+#include "sound_asset.h"
+#include "reel.h"
+#include "test.h"
+
+using boost::shared_ptr;
 
 /* Load a certificate chain from build/test/data/ *.pem and then build
    an encrypted DCP and a KDM using it.
index 5477ca5a189877f4df4b9f7de78192b93c73d8b7..6992acff0e87579277c9a28d86a808ab05e4f95c 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
+#include "dcp.h"
+#include "picture_asset.h"
+#include "sound_asset.h"
+#include "util.h"
+#include "exceptions.h"
+
+using std::vector;
+using std::string;
+
 /* Check that an exception is thrown when trying to create MXFs from non-existant sources */
 BOOST_AUTO_TEST_CASE (error_test)
 {
index d9ba3745e09ccd6f873db5ce8615fbfa42756274..a1ea0ec4351479ddec7c9204e26ace54eb92891c 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
 #include "kdm.h"
 #include "xml/kdm_smpte.h"
 
+using std::list;
+using boost::shared_ptr;
+
 BOOST_AUTO_TEST_CASE (kdm_test)
 {
        libdcp::KDM kdm (
index 41d985f7606196407b7ead288c5e7f3d2c30aa64..c90dff7698a43e16b63c90a1725f108e321e22ad 100644 (file)
@@ -17,6 +17,7 @@
 
 */
 
+#include <boost/test/unit_test.hpp>
 #include "opendcp_lut.h"
 #include "opendcp_lut.cc"
 #include "srgb_linearised_gamma_lut.h"
index 5e6827d14e3fa711ec4849b3ac418fb97ddd180c..0a9ac1198fe31706f6e9da9be4f0aa5b31d64ac8 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
+#include "dcp.h"
+#include "cpl.h"
+
+using std::list;
+using boost::shared_ptr;
+
 /* Read DCP that is in git and make sure that basic stuff is read in correctly */
 BOOST_AUTO_TEST_CASE (read_dcp)
 {
index d8ffea6ac6220122b7b6f90c399ccb829ad0f287..43858b10284a7cd15ab35b7cd4d3d920f3a94f00 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
+#include <boost/filesystem.hpp>
 #include "picture_asset_writer.h"
+#include "picture_asset.h"
+#include "KM_util.h"
+
+using std::string;
+using boost::shared_ptr;
 
 /* Check that recovery from a partially-written MXF works */
 BOOST_AUTO_TEST_CASE (recovery)
index 64a3f6bde26aae5eb15d6ae2c934e9785416c27c..a8fa78b7f5d050b253688d115861332bd95ef523 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
+#include "subtitle_asset.h"
+
+using std::list;
+using boost::shared_ptr;
+
 /* Load a subtitle asset from XML and check that it is read correctly */
 BOOST_AUTO_TEST_CASE (subtitles1)
 {
diff --git a/test/test.cc b/test/test.cc
new file mode 100644 (file)
index 0000000..926eb0f
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libdcp_test
+#include <boost/test/unit_test.hpp>
+#include "util.h"
+
+using std::string;
+
+struct TestConfig
+{
+       TestConfig()
+       {
+               libdcp::init ();
+       }
+};
+
+BOOST_GLOBAL_FIXTURE (TestConfig);
+
+string
+j2c (int)
+{
+       return "test/data/32x32_red_square.j2c";
+}
+
+string
+wav (libdcp::Channel)
+{
+       return "test/data/1s_24-bit_48k_silence.wav";
+}
+
+string test_corpus = "../libdcp-test";
+
diff --git a/test/test.h b/test/test.h
new file mode 100644 (file)
index 0000000..de79036
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+    Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+extern std::string j2c (int);
+extern std::string wav (libdcp::Channel);
+extern std::string test_corpus;
diff --git a/test/tests.cc b/test/tests.cc
deleted file mode 100644 (file)
index 5e63d5e..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <cmath>
-#include <boost/filesystem.hpp>
-#include <libxml++/libxml++.h>
-#include "KM_prng.h"
-#include "dcp.h"
-#include "util.h"
-#include "metadata.h"
-#include "types.h"
-#include "exceptions.h"
-#include "subtitle_asset.h"
-#include "picture_asset.h"
-#include "sound_asset.h"
-#include "reel.h"
-#include "certificates.h"
-#include "signer_chain.h"
-#include "gamma_lut.h"
-#include "cpl.h"
-#include "signer.h"
-
-#define BOOST_TEST_DYN_LINK
-#define BOOST_TEST_MODULE libdcp_test
-#include <boost/test/unit_test.hpp>
-
-using std::string;
-using std::cout;
-using std::vector;
-using std::list;
-using boost::shared_ptr;
-
-struct TestConfig
-{
-       TestConfig()
-       {
-               libdcp::init ();
-       }
-};
-
-BOOST_GLOBAL_FIXTURE (TestConfig);
-
-static string
-j2c (int)
-{
-       return "test/data/32x32_red_square.j2c";
-}
-
-static string
-wav (libdcp::Channel)
-{
-       return "test/data/1s_24-bit_48k_silence.wav";
-}
-
-static string test_corpus = "../libdcp-test";
-
-#include "utc_offset_to_string_test.cc"
-#include "lut_test.cc"
-#include "util_test.cc"
-#include "decryption_test.cc"
-#include "kdm_test.cc"
-#include "dcp_test.cc"
-#include "error_test.cc"
-#include "read_dcp_test.cc"
-#include "subtitle_tests.cc"
-#include "dcp_time_test.cc"
-#include "color_test.cc"
-#include "recovery_test.cc"
-#include "certificates_test.cc"
-
-BOOST_AUTO_TEST_CASE (signer_chain)
-{
-       boost::filesystem::remove_all ("build/test/signer");
-       boost::filesystem::create_directory ("build/test/signer");
-       libdcp::make_signer_chain ("build/test/signer");
-}
-
-#include "encryption_test.cc"
index ad1d124975d42fe68f57fd2da871ca78714c804c..af9c65335e99df1192a74135917936064a866554 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
 #include "metadata.h"
+#include "util.h"
 
-/** Test XMLMetadata::utc_offset_to_string */
+/** Test libdcp::utc_offset_to_string */
 BOOST_AUTO_TEST_CASE (utc_offset_to_string_test)
 {
        BOOST_CHECK_EQUAL (libdcp::utc_offset_to_string (30), "+00:30");
index fa873c755c2b116fa818b837c3cbd6402fdec86e..2ed5e46a4187e3b89155ffb09b19f7e0029ff195 100644 (file)
 */
 
 #include <fstream>
+#include <boost/test/unit_test.hpp>
+#include "util.h"
 
 using std::ifstream;
+using std::string;
 
 BOOST_AUTO_TEST_CASE (bsae64_decode_test)
 {
index 2892bf9ebd2d2915bfc5755e18053efbc1cfb8a1..ec70288bc12382598a213853da18f3148e4faf46 100644 (file)
@@ -20,7 +20,23 @@ def build(bld):
     obj.name   = 'tests'
     obj.uselib = 'BOOST_TEST OPENJPEG CXML XMLSEC1'
     obj.use    = 'libdcp'
-    obj.source = 'tests.cc'
+    obj.source = """
+                 test.cc
+                 certificates_test.cc
+                 dcp_test.cc
+                 encryption_test.cc
+                 lut_test.cc
+                 read_dcp_test.cc
+                 color_test.cc
+                 dcp_time_test.cc
+                 error_test.cc
+                 recovery_test.cc
+                 utc_offset_to_string_test.cc
+                 decryption_test.cc
+                 kdm_test.cc
+                 subtitle_tests.cc
+                 util_test.cc
+                 """
     obj.target = 'tests'
     obj.install_path = ''