blob: 720cf30b04ee16995efdc781f8254cc7ffb0e7ea [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
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -08003from waflib import Utils
4
Alexander Afanasyeva1ae0a12014-01-28 15:21:02 -08005top = '..'
6
7def build(bld):
Junxiao Shi2bea5c42017-08-14 20:10:32 +00008 # core objects that can be shared between unit and integrated tests
Alexander Afanasyev5560fd42018-03-07 17:03:03 -05009 bld.objects(target='tests-base',
10 features='pch',
11 source=bld.path.ant_glob('*.cpp', excl=['main.cpp']),
12 headers=['../src/common-pch.hpp', 'boost-test.hpp'],
13 includes='.',
14 export_includes='.',
15 use='ndn-cxx BOOST')
16
17 config_path = 'UNIT_TEST_CONFIG_PATH="%s"' % bld.bldnode.make_node('tmp-files')
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080018
19 # unit test objects
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050020 src = bld.path.ant_glob(['unit-tests/**/*.cpp'],
21 excl=['**/*-osx.t.cpp', '**/*-sqlite3.t.cpp'])
Alexander Afanasyev0cf887d2017-03-26 16:58:59 -050022 if bld.env['HAVE_OSX_FRAMEWORKS']:
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050023 src += bld.path.ant_glob('unit-tests/**/*-osx.t.cpp')
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080024
25 # In case we want to make it optional later
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050026 src += bld.path.ant_glob('unit-tests/**/*-sqlite3.t.cpp')
27
28 bld.objects(target='unit-test-objects',
29 source=src,
30 use='tests-base',
31 defines=[config_path])
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080032
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080033 # unit test app
Alexander Afanasyev5560fd42018-03-07 17:03:03 -050034 bld.program(target='../unit-tests',
35 name='unit-tests',
36 source='main.cpp',
37 use='unit-test-objects',
38 install_path=None)
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070039
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080040 bld.recurse('integrated')