def configure(conf):
    boost_lib_suffix = ''
    if conf.env.TARGET_WINDOWS:
        boost_lib_suffix = '-mt'

    conf.check_cxx(fragment="""
                            #define BOOST_TEST_MODULE Config test\n
    			    #include <boost/test/unit_test.hpp>\n
                            int main() {}
                            """,
                            msg='Checking for boost unit testing library',
                            lib='boost_unit_test_framework%s' % boost_lib_suffix,
                            uselib_store='BOOST_TEST')

    conf.env.prepend_value('LINKFLAGS', '-Lsrc')

def build(bld):
    obj = bld(features='cxx cxxprogram')
    obj.name   = 'tests'
    obj.uselib = 'BOOST_TEST BOOST_REGEX BOOST_FILESYSTEM DCP CXML ASDCPLIB_CTH'
    obj.use    = 'libsub-1.0'
    obj.source = """
                 dcp_reader_test.cc
                 dcp_to_stl_binary_test.cc
                 iso6937_test.cc
                 ssa_reader_test.cc
                 stl_binary_reader_test.cc
                 stl_binary_writer_test.cc
                 stl_text_reader_test.cc
                 subrip_reader_test.cc
                 time_test.cc
                 test.cc
                 vertical_position_test.cc
                 """
    obj.target = 'tests'
    obj.install_path = ''
