Yingdi Yu | c9843cf | 2014-08-04 17:52:19 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
| 3 | """ |
| 4 | Copyright (c) 2014, Regents of the University of California |
| 5 | |
| 6 | This file is part of NSL (NDN Signature Logger). |
| 7 | See AUTHORS.md for complete list of NSL authors and contributors. |
| 8 | |
| 9 | NSL is free software: you can redistribute it and/or modify it under the terms |
| 10 | of the GNU General Public License as published by the Free Software Foundation, |
| 11 | either version 3 of the License, or (at your option) any later version. |
| 12 | |
| 13 | NSL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 14 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 15 | PURPOSE. See the GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License along with |
| 18 | NSL, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 19 | """ |
| 20 | |
| 21 | top = '..' |
| 22 | |
| 23 | def 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 Yu | 0c3e591 | 2015-03-17 14:22:38 -0700 | [diff] [blame] | 45 | defines=['TEST_HOME_PATH=\"%s/home-tests\"' %(bld.bldnode)], |
Yingdi Yu | c9843cf | 2014-08-04 17:52:19 -0700 | [diff] [blame] | 46 | ) |
| 47 | |
| 48 | # unit tests |
| 49 | unit_tests = bld.program( |
| 50 | target='../unit-tests', |
| 51 | features='cxx cxxprogram', |
Yingdi Yu | 0c3e591 | 2015-03-17 14:22:38 -0700 | [diff] [blame] | 52 | source=bld.path.ant_glob(['core/**/*.t.cpp', 'daemon/**/*.t.cpp']), |
Yingdi Yu | c9843cf | 2014-08-04 17:52:19 -0700 | [diff] [blame] | 53 | use='core-objects daemon-objects unit-tests-base unit-tests-main', |
| 54 | includes='.', |
| 55 | install_path=None, |
Yingdi Yu | 0c3e591 | 2015-03-17 14:22:38 -0700 | [diff] [blame] | 56 | 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 Yu | c9843cf | 2014-08-04 17:52:19 -0700 | [diff] [blame] | 59 | ) |