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 | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 8 | bld(features=['cxx', 'pch'], |
| 9 | name='tests-base', |
| 10 | target='tests-base', |
| 11 | headers=['../src/common-pch.hpp', 'boost-test.hpp'], |
Alexander Afanasyev | 766cea7 | 2014-04-24 19:16:42 -0700 | [diff] [blame] | 12 | use='ndn-cxx', |
Alexander Afanasyev | b1db7c6 | 2014-04-03 14:57:25 -0700 | [diff] [blame] | 13 | includes='.', |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 14 | ) |
| 15 | |
| 16 | unit_tests = bld( |
| 17 | target="unit-test-objects", |
| 18 | name="unit-test-objects", |
| 19 | features="cxx", |
| 20 | source=bld.path.ant_glob(['unit-tests/**/*.cpp'], |
| 21 | excl=['**/*-osx.cpp', '**/*-sqlite3.cpp']), |
| 22 | use='tests-base', |
| 23 | includes='.', |
| 24 | install_path=None, |
| 25 | ) |
| 26 | |
| 27 | integrated = bld( |
| 28 | target="integrated-test-objects", |
| 29 | name="integrated-test-objects", |
| 30 | features="cxx", |
| 31 | source=bld.path.ant_glob(['integrated/**/*.cpp'], |
| 32 | excl=['**/*-osx.cpp', '**/*-sqlite3.cpp']), |
| 33 | use='tests-base', |
| 34 | includes='.', |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 35 | install_path=None, |
Alexander Afanasyev | d409d59 | 2014-01-28 18:36:38 -0800 | [diff] [blame] | 36 | ) |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 37 | |
Alexander Afanasyev | 59d67a5 | 2014-04-03 16:09:31 -0700 | [diff] [blame] | 38 | if bld.env['HAVE_OSX_SECURITY']: |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 39 | unit_tests.source += bld.path.ant_glob('unit-tests/**/*-osx.cpp') |
| 40 | integrated.source += bld.path.ant_glob('integrated/**/*-osx.cpp') |
Alexander Afanasyev | 31ae15f | 2014-01-29 20:58:00 -0800 | [diff] [blame] | 41 | |
| 42 | # In case we want to make it optional later |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 43 | unit_tests.source += bld.path.ant_glob('unit-tests/**/*-sqlite3.cpp') |
| 44 | integrated.source += bld.path.ant_glob('integrated/**/*-sqlite3.cpp') |
Alexander Afanasyev | e2dcdfd | 2014-02-07 15:53:28 -0800 | [diff] [blame] | 45 | |
Alexander Afanasyev | 8b88160 | 2014-11-20 19:58:07 -0800 | [diff] [blame] | 46 | bld(features='cxx', |
| 47 | target='unit-tests-main-unit', |
| 48 | name='unit-tests-main-unit', |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 49 | source=bld.path.ant_glob(['*.cpp']), |
| 50 | use='ndn-cxx', |
Alexander Afanasyev | 8b88160 | 2014-11-20 19:58:07 -0800 | [diff] [blame] | 51 | defines=['BOOST_TEST_MODULE=ndn-cxx Unit Tests'], |
| 52 | ) |
| 53 | |
| 54 | bld(features='cxx', |
| 55 | target='unit-tests-main-integrated', |
| 56 | name='unit-tests-main-integrated', |
| 57 | source=bld.path.ant_glob(['*.cpp']), |
| 58 | use='ndn-cxx', |
| 59 | defines=['BOOST_TEST_MODULE=ndn-cxx Integrated Tests'], |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 60 | ) |
| 61 | |
| 62 | bld(features="cxx cxxprogram", |
| 63 | target="../unit-tests", |
Alexander Afanasyev | 8b88160 | 2014-11-20 19:58:07 -0800 | [diff] [blame] | 64 | use="unit-test-objects unit-tests-main-unit", |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 65 | install_path=None) |
| 66 | |
| 67 | bld(features="cxx cxxprogram", |
| 68 | target="../integrated-tests", |
Alexander Afanasyev | 8b88160 | 2014-11-20 19:58:07 -0800 | [diff] [blame] | 69 | use="integrated-test-objects unit-tests-main-integrated", |
Alexander Afanasyev | 8b1674a | 2014-05-15 00:58:43 -0700 | [diff] [blame] | 70 | install_path=None) |