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): |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 8 | # precompiled headers (if enabled) |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 9 | bld(features=['cxx', 'pch'], |
| 10 | name='tests-base', |
| 11 | target='tests-base', |
| 12 | headers=['../src/common-pch.hpp', 'boost-test.hpp'], |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 13 | use='ndn-cxx BOOST', |
| 14 | includes='.') |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 15 | |
Junxiao Shi | 2bea5c4 | 2017-08-14 20:10:32 +0000 | [diff] [blame^] | 16 | # core objects that can be shared between unit and integrated tests |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 17 | bld(features="cxx", |
| 18 | target="boost-tests-base", |
Junxiao Shi | 2bea5c4 | 2017-08-14 20:10:32 +0000 | [diff] [blame^] | 19 | source=bld.path.ant_glob(['*.cpp'], excl=['main.cpp']), |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 20 | use='ndn-cxx tests-base BOOST', |
| 21 | includes='.', |
| 22 | install_path=None) |
| 23 | |
| 24 | # unit test objects |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 25 | unit_tests = bld( |
| 26 | target="unit-test-objects", |
| 27 | name="unit-test-objects", |
| 28 | features="cxx", |
| 29 | source=bld.path.ant_glob(['unit-tests/**/*.cpp'], |
Spyridon Mastorakis | 429634f | 2015-02-19 17:35:33 -0800 | [diff] [blame] | 30 | excl=['**/*-osx.t.cpp', '**/*-sqlite3.t.cpp']), |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 31 | use='ndn-cxx tests-base BOOST', |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 32 | includes='.', |
Mickey Sweatt | 7f17790 | 2015-06-10 17:20:19 -0700 | [diff] [blame] | 33 | defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' %(bld.bldnode), |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 34 | install_path=None) |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 35 | |
Alexander Afanasyev | 0cf887d | 2017-03-26 16:58:59 -0500 | [diff] [blame] | 36 | if bld.env['HAVE_OSX_FRAMEWORKS']: |
Spyridon Mastorakis | 429634f | 2015-02-19 17:35:33 -0800 | [diff] [blame] | 37 | unit_tests.source += bld.path.ant_glob('unit-tests/**/*-osx.t.cpp') |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 38 | |
| 39 | # In case we want to make it optional later |
Spyridon Mastorakis | 429634f | 2015-02-19 17:35:33 -0800 | [diff] [blame] | 40 | unit_tests.source += bld.path.ant_glob('unit-tests/**/*-sqlite3.t.cpp') |
Alexander Afanasyev | e2dcdfd | 2014-02-07 15:53:28 -0800 | [diff] [blame] | 41 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 42 | # unit test app |
| 43 | bld(features='cxx cxxprogram', |
| 44 | target='../unit-tests', |
Alexander Afanasyev | 8b88160 | 2014-11-20 19:58:07 -0800 | [diff] [blame] | 45 | name='unit-tests-main-unit', |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 46 | source="main.cpp", |
| 47 | use='ndn-cxx unit-test-objects boost-tests-base BOOST', |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 48 | install_path=None) |
| 49 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 50 | bld.recurse('integrated') |