blob: f924b5e2e83920213de22171621608c00b8437e3 [file] [log] [blame]
Yingdi Yuc9843cf2014-08-04 17:52:19 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3"""
4Copyright (c) 2014, Regents of the University of California
5
6This file is part of NSL (NDN Signature Logger).
7See AUTHORS.md for complete list of NSL authors and contributors.
8
9NSL is free software: you can redistribute it and/or modify it under the terms
10of the GNU General Public License as published by the Free Software Foundation,
11either version 3 of the License, or (at your option) any later version.
12
13NSL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
14without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15PURPOSE. See the GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License along with
18NSL, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
19"""
20
21top = '..'
22
23def build(bld):
24 # Unit tests
25 if bld.env['WITH_TESTS']:
26 # main()
27 unit_test_main = bld(
28 target='unit-tests-main',
29 name='unit-tests-main',
30 features='cxx',
31 use='core-objects',
32 source='main.cpp',
33 install_path=None,
34 )
35
36 # common test modules
37 unit_test_base = bld(
38 target='unit-tests-base',
39 name='unit-tests-base',
40 features='cxx',
41 source=bld.path.ant_glob(['*.cpp'], excl='main.cpp'),
42 use='core-objects',
43 headers='../common.hpp boost-test.hpp',
44 install_path=None,
Yingdi Yu0c3e5912015-03-17 14:22:38 -070045 defines=['TEST_HOME_PATH=\"%s/home-tests\"' %(bld.bldnode)],
Yingdi Yuc9843cf2014-08-04 17:52:19 -070046 )
47
48 # unit tests
49 unit_tests = bld.program(
50 target='../unit-tests',
51 features='cxx cxxprogram',
Yingdi Yu0c3e5912015-03-17 14:22:38 -070052 source=bld.path.ant_glob(['core/**/*.t.cpp', 'daemon/**/*.t.cpp']),
Yingdi Yuc9843cf2014-08-04 17:52:19 -070053 use='core-objects daemon-objects unit-tests-base unit-tests-main',
54 includes='.',
55 install_path=None,
Yingdi Yu0c3e5912015-03-17 14:22:38 -070056 defines=['TEST_DB_PATH=\"%s/db-tests\"' %(bld.bldnode),
57 'TEST_KEYCHAIN_PATH=\"%s/keychain-tests\"' %(bld.bldnode),
58 'TEST_LOGGER_PATH=\"%s/logger-tests\"' %(bld.bldnode)],
Yingdi Yuc9843cf2014-08-04 17:52:19 -070059 )