blob: c4cbfbf648147e1eebb2c3a2eb5ebc820e078316 [file] [log] [blame]
Alexander Afanasyeva1ae0a12014-01-28 15:21:02 -08001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -08003from waflib import Utils
4
Alexander Afanasyeva1ae0a12014-01-28 15:21:02 -08005top = '..'
6
7def build(bld):
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -07008 bld(features=['cxx', 'pch'],
9 name='tests-base',
10 target='tests-base',
11 headers=['../src/common-pch.hpp', 'boost-test.hpp'],
Alexander Afanasyev766cea72014-04-24 19:16:42 -070012 use='ndn-cxx',
Alexander Afanasyevb1db7c62014-04-03 14:57:25 -070013 includes='.',
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070014 )
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 Afanasyev5e1288e2014-03-28 11:11:48 -070035 install_path=None,
Alexander Afanasyevd409d592014-01-28 18:36:38 -080036 )
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080037
Alexander Afanasyev59d67a52014-04-03 16:09:31 -070038 if bld.env['HAVE_OSX_SECURITY']:
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070039 unit_tests.source += bld.path.ant_glob('unit-tests/**/*-osx.cpp')
40 integrated.source += bld.path.ant_glob('integrated/**/*-osx.cpp')
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080041
42 # In case we want to make it optional later
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070043 unit_tests.source += bld.path.ant_glob('unit-tests/**/*-sqlite3.cpp')
44 integrated.source += bld.path.ant_glob('integrated/**/*-sqlite3.cpp')
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080045
Alexander Afanasyev8b881602014-11-20 19:58:07 -080046 bld(features='cxx',
47 target='unit-tests-main-unit',
48 name='unit-tests-main-unit',
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070049 source=bld.path.ant_glob(['*.cpp']),
50 use='ndn-cxx',
Alexander Afanasyev8b881602014-11-20 19:58:07 -080051 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 Afanasyev8b1674a2014-05-15 00:58:43 -070060 )
61
62 bld(features="cxx cxxprogram",
63 target="../unit-tests",
Alexander Afanasyev8b881602014-11-20 19:58:07 -080064 use="unit-test-objects unit-tests-main-unit",
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070065 install_path=None)
66
67 bld(features="cxx cxxprogram",
68 target="../integrated-tests",
Alexander Afanasyev8b881602014-11-20 19:58:07 -080069 use="integrated-test-objects unit-tests-main-integrated",
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070070 install_path=None)