blob: 22e04162ce2a6179a59337eca8e2e16f5c40c97b [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):
Davide Pesavento74daf742018-11-23 18:14:13 -05006 # common 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 Pesavento74daf742018-11-23 18:14:13 -050018 src = bld.path.ant_glob('unit/**/*.cpp', excl=['**/*-osx.t.cpp',
19 '**/*-sqlite3.t.cpp'])
20
Alexander Afanasyev0cf887d2017-03-26 16:58:59 -050021 if bld.env['HAVE_OSX_FRAMEWORKS']:
Davide Pesavento74daf742018-11-23 18:14:13 -050022 src += bld.path.ant_glob('unit/**/*-osx.t.cpp')
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080023
24 # In case we want to make it optional later
Davide Pesavento74daf742018-11-23 18:14:13 -050025 src += bld.path.ant_glob('unit/**/*-sqlite3.t.cpp')
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050026
Davide Pesavento19442812018-11-23 14:00:04 -050027 bld.objects(target='unit-tests-objects',
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050028 source=src,
29 use='tests-base',
30 defines=[config_path])
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080031
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080032 # unit test app
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050033 bld.program(target='../unit-tests',
34 name='unit-tests',
35 source='main.cpp',
Davide Pesavento19442812018-11-23 14:00:04 -050036 use='unit-tests-objects',
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050037 install_path=None)
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070038
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080039 bld.recurse('integrated')