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 | |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 3 | from waflib import Utils |
| 4 | |
Alexander Afanasyev | a1ae0a1 | 2014-01-28 15:21:02 -0800 | [diff] [blame] | 5 | top = '..' |
| 6 | |
| 7 | def build(bld): |
Junxiao Shi | 2bea5c4 | 2017-08-14 20:10:32 +0000 | [diff] [blame] | 8 | # core objects that can be shared between unit and integrated tests |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 9 | 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 Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 18 | |
| 19 | # unit test objects |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 20 | src = bld.path.ant_glob(['unit-tests/**/*.cpp'], |
| 21 | excl=['**/*-osx.t.cpp', '**/*-sqlite3.t.cpp']) |
Alexander Afanasyev | 0cf887d | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 22 | if bld.env['HAVE_OSX_FRAMEWORKS']: |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 23 | src += bld.path.ant_glob('unit-tests/**/*-osx.t.cpp') |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 24 | |
| 25 | # In case we want to make it optional later |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 26 | 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 Afanasyev | e2dcdfd | 2014-02-07 15:53:28 -0800 | [diff] [blame] | 32 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 33 | # unit test app |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 34 | bld.program(target='../unit-tests', |
| 35 | name='unit-tests', |
| 36 | source='main.cpp', |
| 37 | use='unit-test-objects', |
| 38 | install_path=None) |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 39 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 40 | bld.recurse('integrated') |