blob: af4b422cee72d0e66ff4759a39f4468f22a6b73f [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",
Alexander Afanasyevfc99b512017-01-04 11:10:36 -080019 source="identity-management-fixture.cpp",
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080020 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'],
Spyridon Mastorakis429634f2015-02-19 17:35:33 -080030 excl=['**/*-osx.t.cpp', '**/*-sqlite3.t.cpp']),
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080031 use='ndn-cxx tests-base BOOST',
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070032 includes='.',
Mickey Sweatt7f177902015-06-10 17:20:19 -070033 defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' %(bld.bldnode),
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080034 install_path=None)
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080035
Alexander Afanasyev0cf887d2017-03-26 16:58:59 -050036 if bld.env['HAVE_OSX_FRAMEWORKS']:
Spyridon Mastorakis429634f2015-02-19 17:35:33 -080037 unit_tests.source += bld.path.ant_glob('unit-tests/**/*-osx.t.cpp')
Alexander Afanasyev31ae15f2014-01-29 20:58:00 -080038
39 # In case we want to make it optional later
Spyridon Mastorakis429634f2015-02-19 17:35:33 -080040 unit_tests.source += bld.path.ant_glob('unit-tests/**/*-sqlite3.t.cpp')
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080041
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080042 # unit test app
43 bld(features='cxx cxxprogram',
44 target='../unit-tests',
Alexander Afanasyev8b881602014-11-20 19:58:07 -080045 name='unit-tests-main-unit',
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080046 source="main.cpp",
47 use='ndn-cxx unit-test-objects boost-tests-base BOOST',
Alexander Afanasyev8b1674a2014-05-15 00:58:43 -070048 install_path=None)
49
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080050 bld.recurse('integrated')