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 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 16 | # core modules that can be shared between unit and integrated tests |
| 17 | bld(features="cxx", |
| 18 | target="boost-tests-base", |
| 19 | source="identity-management-fixture.cpp", |
| 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'], |
| 30 | excl=['**/*-osx.cpp', '**/*-sqlite3.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='.', |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 33 | install_path=None) |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 34 | |
Alexander Afanasyev | 59d67a5 | 2014-04-03 16:09:31 -0700 | [diff] [blame] | 35 | if bld.env['HAVE_OSX_SECURITY']: |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 36 | unit_tests.source += bld.path.ant_glob('unit-tests/**/*-osx.cpp') |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 37 | |
| 38 | # In case we want to make it optional later |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 39 | unit_tests.source += bld.path.ant_glob('unit-tests/**/*-sqlite3.cpp') |
Alexander Afanasyev | e2dcdfd | 2014-02-07 15:53:28 -0800 | [diff] [blame] | 40 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 41 | # unit test app |
| 42 | bld(features='cxx cxxprogram', |
| 43 | target='../unit-tests', |
Alexander Afanasyev | 8b88160 | 2014-11-20 19:58:07 -0800 | [diff] [blame] | 44 | name='unit-tests-main-unit', |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 45 | source="main.cpp", |
| 46 | use='ndn-cxx unit-test-objects boost-tests-base BOOST', |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 47 | install_path=None) |
| 48 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 49 | bld.recurse('integrated') |