blob: cf433826f4fe4cf7b0dceeac72d61f2bf3cb5c41 [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 Afanasyeve6c65e22015-01-28 19:56:03 -08008 # precompiled headers (if enabled)
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -07009 bld(features=['cxx', 'pch'],
10 name='tests-base',
11 target='tests-base',
12 headers=['../src/common-pch.hpp', 'boost-test.hpp'],
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080013 use='ndn-cxx BOOST',
14 includes='.')
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070015
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080016 # 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 Afanasyev8b1674a2014-05-15 00:58:43 -070025 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 Afanasyeve6c65e22015-01-28 19:56:03 -080031 use='ndn-cxx tests-base BOOST',
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070032 includes='.',
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080033 install_path=None)
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080034
Alexander Afanasyev59d67a52014-04-03 16:09:31 -070035 if bld.env['HAVE_OSX_SECURITY']:
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070036 unit_tests.source += bld.path.ant_glob('unit-tests/**/*-osx.cpp')
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080037
38 # In case we want to make it optional later
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070039 unit_tests.source += bld.path.ant_glob('unit-tests/**/*-sqlite3.cpp')
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080040
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080041 # unit test app
42 bld(features='cxx cxxprogram',
43 target='../unit-tests',
Alexander Afanasyev8b881602014-11-20 19:58:07 -080044 name='unit-tests-main-unit',
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080045 source="main.cpp",
46 use='ndn-cxx unit-test-objects boost-tests-base BOOST',
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070047 install_path=None)
48
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080049 bld.recurse('integrated')