Add gcov test coverage (written to build/test/coverage) and a couple more tests.
[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 OPENJPEG CXML XMLSEC1 SNDFILE'
22     if bld.env.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                  certificates_test.cc
29                  colour_test.cc
30                  cpl_sar_test.cc
31                  dcp_test.cc
32                  dcp_time_test.cc
33                  decryption_test.cc
34                  encryption_test.cc
35                  fraction_test.cc
36                  frame_info_test.cc
37                  local_time_test.cc
38                  kdm_test.cc
39                  read_dcp_test.cc
40                  recovery_test.cc
41                  round_trip_test.cc
42                  subtitle_tests.cc
43                  test.cc 
44                  util_test.cc
45                  """
46     obj.target = 'tests'
47     obj.install_path = ''
48
49     obj = bld(features='cxx cxxprogram')
50     obj.name   = 'subs_in_out'
51     obj.uselib = 'BOOST_TEST OPENJPEG CXML'
52     obj.use    = 'libdcp%s' % bld.env.API_VERSION
53     obj.source = 'subs_in_out.cc'
54     obj.target = 'subs_in_out'
55     obj.install_path = ''
56
57     obj = bld(features='cxx cxxprogram')
58     obj.name   = 'rewrite_subs'
59     obj.uselib = 'BOOST_TEST OPENJPEG CXML'
60     obj.use    = 'libdcp%s' % bld.env.API_VERSION
61     obj.source = 'rewrite_subs.cc'
62     obj.target = 'rewrite_subs'
63     obj.install_path = ''