blob: 20c49dab4e34d98edc53615257e6e09e46d819fd [file] [log] [blame]
Alexander Afanasyeva1ae0a12014-01-28 15:21:02 -08001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3top = '..'
4
5def build(bld):
Junxiao Shi2bea5c42017-08-14 20:10:32 +00006 # core objects that can be shared between unit and integrated tests
Alexander Afanasyev5560fd42018-03-07 17:03:03 -05007 bld.objects(target='tests-base',
8 features='pch',
9 source=bld.path.ant_glob('*.cpp', excl=['main.cpp']),
Davide Pesavento19442812018-11-23 14:00:04 -050010 headers=['../ndn-cxx/common-pch.hpp', 'boost-test.hpp'],
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050011 includes='.',
12 export_includes='.',
13 use='ndn-cxx BOOST')
14
15 config_path = 'UNIT_TEST_CONFIG_PATH="%s"' % bld.bldnode.make_node('tmp-files')
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080016
17 # unit test objects
Davide Pesavento19442812018-11-23 14:00:04 -050018 src = bld.path.ant_glob('unit-tests/**/*.cpp',
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050019 excl=['**/*-osx.t.cpp', '**/*-sqlite3.t.cpp'])
Alexander Afanasyev0cf887d2017-03-26 16:58:59 -050020 if bld.env['HAVE_OSX_FRAMEWORKS']:
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050021 src += bld.path.ant_glob('unit-tests/**/*-osx.t.cpp')
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080022
23 # In case we want to make it optional later
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050024 src += bld.path.ant_glob('unit-tests/**/*-sqlite3.t.cpp')
25
Davide Pesavento19442812018-11-23 14:00:04 -050026 bld.objects(target='unit-tests-objects',
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050027 source=src,
28 use='tests-base',
29 defines=[config_path])
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080030
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080031 # unit test app
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050032 bld.program(target='../unit-tests',
33 name='unit-tests',
34 source='main.cpp',
Davide Pesavento19442812018-11-23 14:00:04 -050035 use='unit-tests-objects',
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050036 install_path=None)
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070037
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080038 bld.recurse('integrated')