Merge branch '1.0' of ssh://main.carlh.net/home/carl/git/libdcp into 1.0
[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'
22     if bld.is_defined('HAVE_GCOV'):
23         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
24         obj.lib = ['gcov']
25     else:
26         obj.use = 'libdcp%s' % bld.env.API_VERSION
27     obj.source = """
28                  asset_test.cc
29                  certificates_test.cc
30                  colour_test.cc
31                  colour_conversion_test.cc
32                  cpl_sar_test.cc
33                  dcp_font_test.cc
34                  dcp_test.cc
35                  dcp_time_test.cc
36                  decryption_test.cc
37                  effect_test.cc
38                  encryption_test.cc
39                  exception_test.cc
40                  fraction_test.cc
41                  gamma_transfer_function_test.cc
42                  interop_load_font_test.cc
43                  local_time_test.cc
44                  kdm_test.cc
45                  read_dcp_test.cc
46                  read_interop_subtitle_test.cc
47                  read_smpte_subtitle_test.cc
48                  recovery_test.cc
49                  rgb_xyz_test.cc
50                  round_trip_test.cc
51                  smpte_load_font_test.cc
52                  sound_frame_test.cc
53                  test.cc
54                  text_test.cc
55                  util_test.cc
56                  write_subtitle_test.cc
57                  """
58     obj.target = 'tests'
59     obj.install_path = ''
60     obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
61
62     obj = bld(features='cxx cxxprogram')
63     obj.name   = 'subs_in_out'
64     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML'
65     if bld.is_defined('HAVE_GCOV'):
66         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
67         obj.lib = ['gcov']
68     else:
69         obj.use = 'libdcp%s' % bld.env.API_VERSION
70     obj.source = 'subs_in_out.cc'
71     obj.target = 'subs_in_out'
72     obj.install_path = ''
73     obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
74
75     obj = bld(features='cxx cxxprogram')
76     obj.name   = 'rewrite_subs'
77     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML'
78     if bld.is_defined('HAVE_GCOV'):
79         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
80         obj.lib = ['gcov']
81     else:
82         obj.use = 'libdcp%s' % bld.env.API_VERSION
83     obj.source = 'rewrite_subs.cc'
84     obj.target = 'rewrite_subs'
85     obj.install_path = ''
86     obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']