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): |
Davide Pesavento | 74daf74 | 2018-11-23 18:14:13 -0500 | [diff] [blame] | 6 | # common 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 | 74daf74 | 2018-11-23 18:14:13 -0500 | [diff] [blame] | 18 | src = bld.path.ant_glob('unit/**/*.cpp', excl=['**/*-osx.t.cpp', |
| 19 | '**/*-sqlite3.t.cpp']) |
| 20 | |
Alexander Afanasyev | 0cf887d | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 21 | if bld.env['HAVE_OSX_FRAMEWORKS']: |
Davide Pesavento | 74daf74 | 2018-11-23 18:14:13 -0500 | [diff] [blame] | 22 | src += bld.path.ant_glob('unit/**/*-osx.t.cpp') |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 23 | |
| 24 | # In case we want to make it optional later |
Davide Pesavento | 74daf74 | 2018-11-23 18:14:13 -0500 | [diff] [blame] | 25 | src += bld.path.ant_glob('unit/**/*-sqlite3.t.cpp') |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 26 | |
Davide Pesavento | 1944281 | 2018-11-23 14:00:04 -0500 | [diff] [blame] | 27 | bld.objects(target='unit-tests-objects', |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 28 | source=src, |
| 29 | use='tests-base', |
| 30 | defines=[config_path]) |
Alexander Afanasyev | e2dcdfd | 2014-02-07 15:53:28 -0800 | [diff] [blame] | 31 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 32 | # unit test app |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 33 | bld.program(target='../unit-tests', |
| 34 | name='unit-tests', |
| 35 | source='main.cpp', |
Davide Pesavento | 1944281 | 2018-11-23 14:00:04 -0500 | [diff] [blame] | 36 | use='unit-tests-objects', |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 37 | install_path=None) |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 38 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 39 | bld.recurse('integrated') |