blob: 89a06ccb43279c1cf05c428698003156647751bf [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'],
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 Afanasyev59d67a52014-04-03 16:09:31 -070036 if bld.env['HAVE_OSX_SECURITY']:
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')