diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-18 16:07:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-18 16:07:35 +0100 |
| commit | 59404039618db5d70a2f8fc0cb8c49ae4f8ce527 (patch) | |
| tree | 7eb15ce9c90240aaeacefce9f018281d720b248c /test | |
| parent | ae3b01aab7ef9e6101a7a1a11c511706148a9f1e (diff) | |
Split test compile up into individual files.
Diffstat (limited to 'test')
| -rw-r--r-- | test/audio_delay_test.cc | 9 | ||||
| -rw-r--r-- | test/black_fill_test.cc | 7 | ||||
| -rw-r--r-- | test/client_server_test.cc | 11 | ||||
| -rw-r--r-- | test/ffmpeg_dcp_test.cc | 10 | ||||
| -rw-r--r-- | test/ffmpeg_examiner_test.cc | 7 | ||||
| -rw-r--r-- | test/ffmpeg_pts_offset.cc | 7 | ||||
| -rw-r--r-- | test/film_metadata_test.cc | 12 | ||||
| -rw-r--r-- | test/frame_rate_test.cc | 7 | ||||
| -rw-r--r-- | test/image_test.cc | 6 | ||||
| -rw-r--r-- | test/job_test.cc | 8 | ||||
| -rw-r--r-- | test/make_black_test.cc | 10 | ||||
| -rw-r--r-- | test/pixel_formats_test.cc | 8 | ||||
| -rw-r--r-- | test/play_test.cc | 8 | ||||
| -rw-r--r-- | test/ratio_test.cc | 5 | ||||
| -rw-r--r-- | test/scaling_test.cc | 8 | ||||
| -rw-r--r-- | test/silence_padding_test.cc | 9 | ||||
| -rw-r--r-- | test/stream_test.cc | 5 | ||||
| -rw-r--r-- | test/test.cc | 62 | ||||
| -rw-r--r-- | test/test.h | 23 | ||||
| -rw-r--r-- | test/util_test.cc | 7 | ||||
| -rw-r--r-- | test/wscript | 22 |
21 files changed, 194 insertions, 57 deletions
diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc index 73977bf3a..929a941d6 100644 --- a/test/audio_delay_test.cc +++ b/test/audio_delay_test.cc @@ -17,13 +17,20 @@ */ +#include <boost/test/unit_test.hpp> #include <libdcp/sound_frame.h> #include <libdcp/cpl.h> #include <libdcp/reel.h> #include <libdcp/sound_asset.h> -#include "sndfile_content.h" +#include "lib/sndfile_content.h" +#include "lib/dcp_content_type.h" +#include "lib/ratio.h" +#include "lib/film.h" +#include "test.h" +using std::string; using boost::lexical_cast; +using boost::shared_ptr; static void test_audio_delay (int delay_in_ms) diff --git a/test/black_fill_test.cc b/test/black_fill_test.cc index 51ce605f8..48cf1f53c 100644 --- a/test/black_fill_test.cc +++ b/test/black_fill_test.cc @@ -17,7 +17,12 @@ */ -#include "imagemagick_content.h" +#include <boost/test/unit_test.hpp> +#include "lib/imagemagick_content.h" +#include "lib/dcp_content_type.h" +#include "lib/film.h" +#include "lib/ratio.h" +#include "test.h" /** @file test/black_fill_test.cc * @brief Test insertion of black frames between video content. diff --git a/test/client_server_test.cc b/test/client_server_test.cc index f3d72c2fc..7b5b2b7ef 100644 --- a/test/client_server_test.cc +++ b/test/client_server_test.cc @@ -17,6 +17,17 @@ */ +#include <boost/test/unit_test.hpp> +#include <boost/thread.hpp> +#include "lib/server.h" +#include "lib/image.h" +#include "lib/cross.h" +#include "lib/dcp_video_frame.h" + +using std::list; +using boost::shared_ptr; +using boost::thread; + void do_remote_encode (shared_ptr<DCPVideoFrame> frame, ServerDescription* description, shared_ptr<EncodedData> locally_encoded) { diff --git a/test/ffmpeg_dcp_test.cc b/test/ffmpeg_dcp_test.cc index 946bccbb8..66f3af839 100644 --- a/test/ffmpeg_dcp_test.cc +++ b/test/ffmpeg_dcp_test.cc @@ -17,6 +17,16 @@ */ +#include <boost/test/unit_test.hpp> +#include <boost/filesystem.hpp> +#include "lib/film.h" +#include "lib/ffmpeg_content.h" +#include "lib/ratio.h" +#include "lib/dcp_content_type.h" +#include "test.h" + +using boost::shared_ptr; + /** @file test/ffmpeg_dcp_test.cc * @brief Test scaling and black-padding of images from a still-image source. */ diff --git a/test/ffmpeg_examiner_test.cc b/test/ffmpeg_examiner_test.cc index 296444ba7..24c91880b 100644 --- a/test/ffmpeg_examiner_test.cc +++ b/test/ffmpeg_examiner_test.cc @@ -17,7 +17,12 @@ */ -#include "ffmpeg_examiner.h" +#include <boost/test/unit_test.hpp> +#include "lib/ffmpeg_examiner.h" +#include "lib/ffmpeg_content.h" +#include "test.h" + +using boost::shared_ptr; BOOST_AUTO_TEST_CASE (ffmpeg_examiner_test) { diff --git a/test/ffmpeg_pts_offset.cc b/test/ffmpeg_pts_offset.cc index 0ed8f66d8..65cc28a84 100644 --- a/test/ffmpeg_pts_offset.cc +++ b/test/ffmpeg_pts_offset.cc @@ -17,6 +17,13 @@ */ +#include <boost/test/unit_test.hpp> +#include "lib/film.h" +#include "lib/ffmpeg_decoder.h" +#include "test.h" + +using boost::shared_ptr; + BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test) { shared_ptr<Film> film = new_test_film ("ffmpeg_pts_offset_test"); diff --git a/test/film_metadata_test.cc b/test/film_metadata_test.cc index ba4fcced6..324787f19 100644 --- a/test/film_metadata_test.cc +++ b/test/film_metadata_test.cc @@ -17,6 +17,18 @@ */ +#include <sstream> +#include <boost/test/unit_test.hpp> +#include <boost/filesystem.hpp> +#include <boost/date_time.hpp> +#include "lib/film.h" +#include "lib/dcp_content_type.h" +#include "lib/ratio.h" + +using std::string; +using std::stringstream; +using boost::shared_ptr; + BOOST_AUTO_TEST_CASE (film_metadata_test) { string const test_film = "build/test/film_metadata_test"; diff --git a/test/frame_rate_test.cc b/test/frame_rate_test.cc index 89a74e086..2ea7e60a5 100644 --- a/test/frame_rate_test.cc +++ b/test/frame_rate_test.cc @@ -17,6 +17,13 @@ */ +#include <boost/test/unit_test.hpp> +#include "lib/film.h" +#include "lib/config.h" +#include "test.h" + +using boost::shared_ptr; + /* Test Playlist::best_dcp_frame_rate and FrameRateConversion with a single piece of content. */ diff --git a/test/image_test.cc b/test/image_test.cc index 750612cf4..4205e5f48 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -17,6 +17,12 @@ */ +#include <boost/test/unit_test.hpp> +#include "lib/image.h" +#include "lib/scaler.h" + +using boost::shared_ptr; + BOOST_AUTO_TEST_CASE (aligned_image_test) { Image* s = new Image (PIX_FMT_RGB24, libdcp::Size (50, 50), true); diff --git a/test/job_test.cc b/test/job_test.cc index 86c6dc9e3..a3ad1bb6c 100644 --- a/test/job_test.cc +++ b/test/job_test.cc @@ -17,6 +17,14 @@ */ +#include <boost/test/unit_test.hpp> +#include "lib/job.h" +#include "lib/job_manager.h" +#include "lib/cross.h" + +using std::string; +using boost::shared_ptr; + class TestJob : public Job { public: diff --git a/test/make_black_test.cc b/test/make_black_test.cc index 4c2822514..78c7fbbcb 100644 --- a/test/make_black_test.cc +++ b/test/make_black_test.cc @@ -17,6 +17,16 @@ */ +#include <boost/test/unit_test.hpp> +#include <libdcp/util.h> +extern "C" { +#include <libavutil/pixfmt.h> +} +#include "lib/image.h" +#include "lib/scaler.h" + +using std::list; + /* Check that Image::make_black works, and doesn't use values which crash sws_scale(). */ diff --git a/test/pixel_formats_test.cc b/test/pixel_formats_test.cc index ccdda3317..1b720d9bf 100644 --- a/test/pixel_formats_test.cc +++ b/test/pixel_formats_test.cc @@ -17,6 +17,14 @@ */ +#include <boost/test/unit_test.hpp> +#include <list> +extern "C" { +#include <libavutil/pixfmt.h> +#include <libavcodec/avcodec.h> +} +#include "lib/image.h" + using std::list; using std::cout; diff --git a/test/play_test.cc b/test/play_test.cc index 0a15bfed2..909813e2a 100644 --- a/test/play_test.cc +++ b/test/play_test.cc @@ -17,12 +17,18 @@ */ -#include "player.h" +#include <boost/test/unit_test.hpp> +#include "lib/player.h" +#include "lib/ratio.h" +#include "lib/dcp_content_type.h" +#include "test.h" /* This test needs stuff in Player that is only included in debug mode */ #ifdef DCPOMATIC_DEBUG +using std::cout; using boost::optional; +using boost::shared_ptr; struct Video { diff --git a/test/ratio_test.cc b/test/ratio_test.cc index 6311976a3..11517ed11 100644 --- a/test/ratio_test.cc +++ b/test/ratio_test.cc @@ -17,6 +17,11 @@ */ +#include <iostream> +#include <boost/test/unit_test.hpp> +#include <libdcp/util.h> +#include "lib/ratio.h" + using std::ostream; namespace libdcp { diff --git a/test/scaling_test.cc b/test/scaling_test.cc index fd700fbb9..5e8dab308 100644 --- a/test/scaling_test.cc +++ b/test/scaling_test.cc @@ -17,12 +17,18 @@ */ -#include "imagemagick_content.h" +#include <boost/test/unit_test.hpp> +#include "lib/imagemagick_content.h" +#include "lib/ratio.h" +#include "lib/film.h" +#include "lib/dcp_content_type.h" +#include "test.h" /** @file test/scaling_test.cc * @brief Test scaling and black-padding of images from a still-image source. */ +using std::string; using boost::shared_ptr; static void scaling_test_for (shared_ptr<Film> film, shared_ptr<VideoContent> content, string image, string container) diff --git a/test/silence_padding_test.cc b/test/silence_padding_test.cc index e12106536..a8748f851 100644 --- a/test/silence_padding_test.cc +++ b/test/silence_padding_test.cc @@ -17,14 +17,21 @@ */ +#include <boost/test/unit_test.hpp> #include <libdcp/cpl.h> #include <libdcp/dcp.h> #include <libdcp/sound_asset.h> #include <libdcp/sound_frame.h> #include <libdcp/reel.h> -#include "sndfile_content.h" +#include "lib/sndfile_content.h" +#include "lib/film.h" +#include "lib/dcp_content_type.h" +#include "lib/ratio.h" +#include "test.h" +using std::string; using boost::lexical_cast; +using boost::shared_ptr; static void test_silence_padding (int channels) { diff --git a/test/stream_test.cc b/test/stream_test.cc index a95eb708c..b56f133c7 100644 --- a/test/stream_test.cc +++ b/test/stream_test.cc @@ -17,9 +17,14 @@ */ +#include <boost/test/unit_test.hpp> +#include <libxml++/libxml++.h> #include <libcxml/cxml.h> +#include "lib/ffmpeg_content.h" using std::pair; +using std::list; +using boost::shared_ptr; BOOST_AUTO_TEST_CASE (stream_test) { diff --git a/test/test.cc b/test/test.cc index b5142bd63..b3debe68e 100644 --- a/test/test.cc +++ b/test/test.cc @@ -17,45 +17,26 @@ */ -#include <fstream> -#include <iostream> -#include <boost/filesystem.hpp> -#include <boost/algorithm/string/predicate.hpp> -#include <boost/date_time.hpp> +#include <vector> +#include <list> #include <libdcp/dcp.h> -#include "ratio.h" -#include "film.h" -#include "filter.h" -#include "job_manager.h" -#include "util.h" -#include "exceptions.h" -#include "image.h" -#include "log.h" -#include "dcp_video_frame.h" -#include "config.h" -#include "server.h" -#include "cross.h" -#include "job.h" -#include "scaler.h" -#include "ffmpeg_decoder.h" -#include "sndfile_decoder.h" -#include "dcp_content_type.h" -#include "ui_signaller.h" -#include "ratio.h" +#include "lib/config.h" +#include "lib/util.h" +#include "lib/ui_signaller.h" +#include "lib/film.h" +#include "lib/job_manager.h" +#include "lib/job.h" #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE dcpomatic_test #include <boost/test/unit_test.hpp> using std::string; -using std::list; -using std::stringstream; using std::vector; using std::min; using std::cout; using std::cerr; +using std::list; using boost::shared_ptr; -using boost::thread; -using boost::dynamic_pointer_cast; struct TestConfig { @@ -76,7 +57,7 @@ struct TestConfig BOOST_GLOBAL_FIXTURE (TestConfig); -static boost::filesystem::path +boost::filesystem::path test_film_dir (string name) { boost::filesystem::path p; @@ -86,7 +67,7 @@ test_film_dir (string name) return p; } -static shared_ptr<Film> +shared_ptr<Film> new_test_film (string name) { boost::filesystem::path p = test_film_dir (name); @@ -137,7 +118,7 @@ note (libdcp::NoteType, string n) cout << n << "\n"; } -static void +void check_dcp (string ref, string check) { libdcp::DCP ref_dcp (ref); @@ -169,22 +150,3 @@ wait_for_jobs () BOOST_CHECK (!jm->errors()); } - -#include "play_test.cc" -#include "frame_rate_test.cc" -#include "silence_padding_test.cc" -#include "audio_delay_test.cc" -#include "ffmpeg_pts_offset.cc" -#include "ffmpeg_examiner_test.cc" -#include "black_fill_test.cc" -#include "scaling_test.cc" -#include "ratio_test.cc" -#include "pixel_formats_test.cc" -#include "make_black_test.cc" -#include "film_metadata_test.cc" -#include "stream_test.cc" -#include "util_test.cc" -#include "ffmpeg_dcp_test.cc" -#include "job_test.cc" -#include "client_server_test.cc" -#include "image_test.cc" diff --git a/test/test.h b/test/test.h new file mode 100644 index 000000000..6a6ba65ad --- /dev/null +++ b/test/test.h @@ -0,0 +1,23 @@ +/* + Copyright (C) 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 void wait_for_jobs (); +extern boost::shared_ptr<Film> new_test_film (std::string); +extern void check_dcp (std::string, std::string); +extern boost::filesystem::path test_film_dir (std::string); diff --git a/test/util_test.cc b/test/util_test.cc index f75fd0e70..a5e671f23 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -17,6 +17,13 @@ */ +#include <boost/test/unit_test.hpp> +#include "lib/util.h" +#include "lib/exceptions.h" + +using std::string; +using std::vector; + BOOST_AUTO_TEST_CASE (util_test) { string t = "Hello this is a string \"with quotes\" and indeed without them"; diff --git a/test/wscript b/test/wscript index 60d846aea..f4a7061d1 100644 --- a/test/wscript +++ b/test/wscript @@ -14,6 +14,26 @@ def build(bld): obj.name = 'unit-tests' obj.uselib = 'BOOST_TEST DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML' obj.use = 'libdcpomatic' - obj.source = 'test.cc' + obj.source = """ + test.cc + play_test.cc + frame_rate_test.cc + silence_padding_test.cc + audio_delay_test.cc + ffmpeg_pts_offset.cc + ffmpeg_examiner_test.cc + black_fill_test.cc + scaling_test.cc + ratio_test.cc + pixel_formats_test.cc + make_black_test.cc + film_metadata_test.cc + stream_test.cc + util_test.cc + ffmpeg_dcp_test.cc + job_test.cc + client_server_test.cc + image_test.cc + """ obj.target = 'unit-tests' obj.install_path = '' |
