Alexander Afanasyev | a1ae0a1 | 2014-01-28 15:21:02 -0800 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
| 3 | top = '..' |
| 4 | |
| 5 | def build(bld): |
Junxiao Shi | 2bea5c4 | 2017-08-14 20:10:32 +0000 | [diff] [blame] | 6 | # core objects that can be shared between unit and integrated tests |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 7 | bld.objects(target='tests-base', |
| 8 | features='pch', |
| 9 | source=bld.path.ant_glob('*.cpp', excl=['main.cpp']), |
Davide Pesavento | 1944281 | 2018-11-23 14:00:04 -0500 | [diff] [blame^] | 10 | headers=['../ndn-cxx/common-pch.hpp', 'boost-test.hpp'], |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 11 | 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 Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 16 | |
| 17 | # unit test objects |
Davide Pesavento | 1944281 | 2018-11-23 14:00:04 -0500 | [diff] [blame^] | 18 | src = bld.path.ant_glob('unit-tests/**/*.cpp', |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 19 | excl=['**/*-osx.t.cpp', '**/*-sqlite3.t.cpp']) |
Alexander Afanasyev | 0cf887d | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 20 | if bld.env['HAVE_OSX_FRAMEWORKS']: |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 21 | src += bld.path.ant_glob('unit-tests/**/*-osx.t.cpp') |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 22 | |
| 23 | # In case we want to make it optional later |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 24 | src += bld.path.ant_glob('unit-tests/**/*-sqlite3.t.cpp') |
| 25 | |
Davide Pesavento | 1944281 | 2018-11-23 14:00:04 -0500 | [diff] [blame^] | 26 | bld.objects(target='unit-tests-objects', |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 27 | source=src, |
| 28 | use='tests-base', |
| 29 | defines=[config_path]) |
Alexander Afanasyev | e2dcdfd | 2014-02-07 15:53:28 -0800 | [diff] [blame] | 30 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 31 | # unit test app |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 32 | bld.program(target='../unit-tests', |
| 33 | name='unit-tests', |
| 34 | source='main.cpp', |
Davide Pesavento | 1944281 | 2018-11-23 14:00:04 -0500 | [diff] [blame^] | 35 | use='unit-tests-objects', |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 36 | install_path=None) |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 37 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 38 | bld.recurse('integrated') |