Simple pass-through of <Ruby> tags in subtitles.
[libdcp.git] / test / wscript
1 #
2 #    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
3 #
4 #    This file is part of libdcp.
5 #
6 #    libdcp is free software; you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation; either version 2 of the License, or
9 #    (at your option) any later version.
10 #
11 #    libdcp is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with libdcp.  If not, see <http://www.gnu.org/licenses/>.
18 #
19 #    In addition, as a special exception, the copyright holders give
20 #    permission to link the code of portions of this program with the
21 #    OpenSSL library under certain conditions as described in each
22 #    individual source file, and distribute linked combinations
23 #    including the two.
24 #
25 #    You must obey the GNU General Public License in all respects
26 #    for all of the code used other than OpenSSL.  If you modify
27 #    file(s) with this exception, you may extend this exception to your
28 #    version of the file(s), but you are not obligated to do so.  If you
29 #    do not wish to do so, delete this exception statement from your
30 #    version.  If you delete this exception statement from all source
31 #    files in the program, then also delete it here.
32 #
33
34 def configure(conf):
35     if conf.options.target_windows_64:
36         boost_lib_suffix = '-mt-x64'
37     elif conf.options.target_windows_32:
38         boost_lib_suffix = '-mt-x32'
39     else:
40         boost_lib_suffix = ''
41
42     conf.check_cxx(fragment="""
43                             #define BOOST_TEST_MODULE Config test\n
44                             #include <boost/test/unit_test.hpp>\n
45                             int main() {}
46                             """,
47                    msg='Checking for boost unit testing library',
48                    lib='boost_unit_test_framework%s' % boost_lib_suffix,
49                    uselib_store='BOOST_TEST')
50
51     conf.env.prepend_value('LINKFLAGS', '-Lsrc')
52
53 def build(bld):
54     obj = bld(features='cxx cxxprogram')
55     obj.name   = 'tests'
56     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM BOOST_DATETIME OPENJPEG CXML XMLSEC1 SNDFILE OPENMP ASDCPLIB_CTH LIBXML++ OPENSSL XERCES DL'
57     obj.cppflags = ['-fno-inline', '-fno-elide-constructors', '-g', '-O0']
58     if bld.env['CXX_NAME'] == 'gcc':
59         obj.cppflags.append('-fno-default-inline')
60     if bld.is_defined('HAVE_GCOV'):
61         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
62         obj.lib = ['gcov']
63         obj.cppflags.append('-ftest-coverage')
64         obj.cppflags.append('-fprofile-arcs')
65     else:
66         obj.use = 'libdcp%s' % bld.env.API_VERSION
67     obj.source = """
68                  asset_test.cc
69                  atmos_test.cc
70                  certificates_test.cc
71                  colour_test.cc
72                  colour_conversion_test.cc
73                  combine_test.cc
74                  cpl_test.cc
75                  cpl_metadata_test.cc
76                  cpl_sar_test.cc
77                  cpl_ratings_test.cc
78                  dcp_font_test.cc
79                  dcp_test.cc
80                  dcp_time_test.cc
81                  decryption_test.cc
82                  effect_test.cc
83                  encryption_test.cc
84                  exception_test.cc
85                  filesystem_test.cc
86                  fraction_test.cc
87                  frame_info_hash_test.cc
88                  gamma_transfer_function_test.cc
89                  h_align_test.cc
90                  interop_load_font_test.cc
91                  interop_subtitle_test.cc
92                  local_time_test.cc
93                  long_filenames_test.cc
94                  make_digest_test.cc
95                  markers_test.cc
96                  mca_test.cc
97                  kdm_test.cc
98                  key_test.cc
99                  language_tag_test.cc
100                  raw_convert_test.cc
101                  read_dcp_test.cc
102                  read_change_write_test.cc
103                  reel_asset_test.cc
104                  recovery_test.cc
105                  rgb_xyz_test.cc
106                  round_trip_test.cc
107                  shared_subtitle_test.cc
108                  smpte_load_font_test.cc
109                  smpte_subtitle_test.cc
110                  sound_asset_writer_test.cc
111                  sound_frame_test.cc
112                  stream_operators.cc
113                  sync_test.cc
114                  test.cc
115                  util_test.cc
116                  utf8_test.cc
117                  v_align_test.cc
118                  verify_test.cc
119                  """
120     obj.target = 'tests'
121     obj.install_path = ''
122
123     obj = bld(features='cxx cxxprogram')
124     obj.name   = 'subs_in_out'
125     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML OPENMP ASDCPLIB_CTH XMLSEC1 OPENSSL DL LIBXML++'
126     obj.cppflags = ['-fno-inline', '-fno-elide-constructors', '-g', '-O0']
127     if bld.env['CXX_NAME'] == 'gcc':
128         obj.cppflags.append('-fno-default-inline')
129     if bld.is_defined('HAVE_GCOV'):
130         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
131         obj.lib = ['gcov']
132         obj.cppflags.append('-ftest-coverage')
133         obj.cppflags.append('-fprofile-arcs')
134     else:
135         obj.use = 'libdcp%s' % bld.env.API_VERSION
136     obj.source = 'subs_in_out.cc'
137     obj.target = 'subs_in_out'
138     obj.install_path = ''
139
140     obj = bld(features='cxx cxxprogram')
141     obj.name   = 'rewrite_subs'
142     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML OPENMP ASDCPLIB_CTH XMLSEC1 OPENSSL DL LIBXML++'
143     obj.cppflags = ['-fno-inline', '-fno-elide-constructors', '-g', '-O0']
144     if bld.env['CXX_NAME'] == 'gcc':
145         obj.cppflags.append('-fno-default-inline')
146     if bld.is_defined('HAVE_GCOV'):
147         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
148         obj.lib = ['gcov']
149         obj.cppflags.append('-ftest-coverage')
150         obj.cppflags.append('-fprofile-arcs')
151     else:
152         obj.use = 'libdcp%s' % bld.env.API_VERSION
153     obj.source = 'rewrite_subs.cc'
154     obj.target = 'rewrite_subs'
155     obj.install_path = ''