Fix incorrect reading of ScreenAspectRatio.
[libdcp.git] / test / wscript
1 def configure(conf):
2     if conf.options.target_windows:
3         boost_lib_suffix = '-mt'
4     else:
5         boost_lib_suffix = ''
6
7     conf.check_cxx(fragment="""
8                             #define BOOST_TEST_MODULE Config test\n
9                             #include <boost/test/unit_test.hpp>\n
10                             int main() {}
11                             """,
12                    msg='Checking for boost unit testing library',
13                    lib='boost_unit_test_framework%s' % boost_lib_suffix,
14                    uselib_store='BOOST_TEST')
15
16     conf.env.prepend_value('LINKFLAGS', '-Lsrc')
17
18 def build(bld):
19     obj = bld(features='cxx cxxprogram')
20     obj.name   = 'tests'
21     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML XMLSEC1 SNDFILE OPENMP'
22     obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
23     if bld.is_defined('HAVE_GCOV'):
24         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
25         obj.lib = ['gcov']
26         obj.cppflags.append('-ftest-coverage')
27         obj.cppflags.append('-fprofile-arcs')
28     else:
29         obj.use = 'libdcp%s' % bld.env.API_VERSION
30     obj.source = """
31                  asset_test.cc
32                  certificates_test.cc
33                  colour_test.cc
34                  colour_conversion_test.cc
35                  cpl_sar_test.cc
36                  dcp_font_test.cc
37                  dcp_test.cc
38                  dcp_time_test.cc
39                  decryption_test.cc
40                  effect_test.cc
41                  encryption_test.cc
42                  exception_test.cc
43                  fraction_test.cc
44                  gamma_transfer_function_test.cc
45                  interop_load_font_test.cc
46                  local_time_test.cc
47                  kdm_test.cc
48                  read_dcp_test.cc
49                  read_interop_subtitle_test.cc
50                  read_smpte_subtitle_test.cc
51                  reel_asset_test.cc
52                  recovery_test.cc
53                  rgb_xyz_test.cc
54                  round_trip_test.cc
55                  smpte_load_font_test.cc
56                  sound_frame_test.cc
57                  test.cc
58                  text_test.cc
59                  util_test.cc
60                  write_subtitle_test.cc
61                  """
62     obj.target = 'tests'
63     obj.install_path = ''
64
65     obj = bld(features='cxx cxxprogram')
66     obj.name   = 'subs_in_out'
67     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML OPENMP'
68     obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
69     if bld.is_defined('HAVE_GCOV'):
70         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
71         obj.lib = ['gcov']
72         obj.cppflags.append('-ftest-coverage')
73         obj.cppflags.append('-fprofile-arcs')
74     else:
75         obj.use = 'libdcp%s' % bld.env.API_VERSION
76     obj.source = 'subs_in_out.cc'
77     obj.target = 'subs_in_out'
78     obj.install_path = ''
79
80     obj = bld(features='cxx cxxprogram')
81     obj.name   = 'rewrite_subs'
82     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML OPENMP'
83     obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
84     if bld.is_defined('HAVE_GCOV'):
85         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
86         obj.lib = ['gcov']
87         obj.cppflags.append('-ftest-coverage')
88         obj.cppflags.append('-fprofile-arcs')
89     else:
90         obj.use = 'libdcp%s' % bld.env.API_VERSION
91     obj.source = 'rewrite_subs.cc'
92     obj.target = 'rewrite_subs'
93     obj.install_path = ''
94
95     obj = bld(features='cxx cxxprogram')
96     obj.name   = 'bench'
97     obj.uselib = 'BOOST_FILESYSTEM OPENJPEG CXML OPENMP'
98     obj.use = 'libdcp%s' % bld.env.API_VERSION
99     obj.source = 'bench.cc'
100     obj.target = 'bench'
101     obj.install_path = ''