Alexander Afanasyev | 4ffcff2 | 2014-09-02 15:39:20 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
Shock Jiang | 3c72318 | 2014-09-10 16:41:18 -0700 | [diff] [blame] | 3 | from waflib import Utils, Context |
Alexander Afanasyev | 4ffcff2 | 2014-09-02 15:39:20 -0700 | [diff] [blame] | 4 | |
| 5 | top = '..' |
| 6 | |
| 7 | def build(bld): |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 8 | if not bld.env['WITH_TESTS']: |
| 9 | return |
| 10 | dst = bld.bldnode.make_node("conf-test/anchors") |
| 11 | dst.mkdir() |
| 12 | |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 13 | bld(features="subst", |
| 14 | name='test-validator-conf', |
| 15 | source='../validator.conf.sample.in', |
| 16 | target='../conf-test/validator.conf', |
| 17 | use='validator-sample', |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 18 | ANCHORPATH='\"anchors/root.cert\"', |
| 19 | RELATION='is-prefix-of', |
| 20 | ) |
| 21 | |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 22 | bld(features="subst", |
| 23 | name='test-logger-conf', |
| 24 | source='../log4cxx.properties.sample.in', |
| 25 | target='../conf-test/log4cxx.properties.sample', |
| 26 | is_copy=True, |
| 27 | use='log4cxx-sample', |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 28 | ) |
| 29 | |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 30 | bld(features='cxx', |
| 31 | name='unit-tests-main', |
| 32 | target='unit-tests-main', |
| 33 | source='main.cpp', |
Alexander Afanasyev | aa46c27 | 2016-03-09 12:54:12 -0800 | [diff] [blame] | 34 | defines=['BOOST_TEST_MODULE=NDNS Unit Tests', |
| 35 | 'TEST_CONFIG_PATH=\"%s/conf-test\"' %(bld.bldnode)], |
| 36 | use='ndns-objects BOOST' |
| 37 | ) |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 38 | |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 39 | unit_tests = bld.program( |
| 40 | target='../unit-tests', |
| 41 | features='cxx cxxprogram', |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 42 | source=bld.path.ant_glob(['**/*.cpp'], excl=['main.cpp']), |
| 43 | use='ndns-objects unit-tests-main BOOST', |
Alexander Afanasyev | fde570c | 2016-12-19 16:02:55 -0800 | [diff] [blame] | 44 | includes='../src .', |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 45 | install_path=None, |
| 46 | defines='TEST_CONFIG_PATH=\"%s/conf-test\"' %(bld.bldnode) |
| 47 | ) |