blob: 6f3ddb30c481971afb0f27c1dde6ca745e5af867 [file] [log] [blame]
Alexander Afanasyev4ffcff22014-09-02 15:39:20 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
Shock Jiang3c723182014-09-10 16:41:18 -07003from waflib import Utils, Context
Alexander Afanasyev4ffcff22014-09-02 15:39:20 -07004
5top = '..'
6
7def build(bld):
Shock Jiang0b165f42014-10-24 09:08:09 -07008 if not bld.env['WITH_TESTS']:
9 return
Alexander Afanasyev08d18742018-03-15 16:31:28 -040010
11 tmp_folder = bld.bldnode.make_node('tmp-files')
12 config_path = 'TEST_CONFIG_PATH="%s"' % tmp_folder
13 tmp_folder.make_node('anchors').mkdir()
Shock Jiang0b165f42014-10-24 09:08:09 -070014
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080015 bld(features="subst",
16 name='test-validator-conf',
17 source='../validator.conf.sample.in',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040018 target=tmp_folder.make_node('validator.conf'),
Davide Pesaventod01c1a42019-01-21 21:42:45 -050019 ANCHORPATH='\"anchors/root.cert\"')
Shock Jiang0b165f42014-10-24 09:08:09 -070020
Alexander Afanasyev08d18742018-03-15 16:31:28 -040021 bld.objects(
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080022 target='unit-tests-main',
23 source='main.cpp',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040024 defines=['BOOST_TEST_MODULE=NDNS Unit Tests', config_path],
25 use='ndns-objects')
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080026
Alexander Afanasyev08d18742018-03-15 16:31:28 -040027 bld.program(
Shock Jiang0b165f42014-10-24 09:08:09 -070028 target='../unit-tests',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040029 name='unit-tests',
30 source=bld.path.ant_glob('**/*.cpp', excl=['main.cpp']),
31 use='ndns-objects unit-tests-main',
Alexander Afanasyevfde570c2016-12-19 16:02:55 -080032 includes='../src .',
Shock Jiang0b165f42014-10-24 09:08:09 -070033 install_path=None,
Alexander Afanasyev08d18742018-03-15 16:31:28 -040034 defines=[config_path])