blob: 3b485717836d328853e9f7c4842fb8a2c8973a61 [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'),
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080019 use='validator-sample',
Shock Jiang0b165f42014-10-24 09:08:09 -070020 ANCHORPATH='\"anchors/root.cert\"',
21 RELATION='is-prefix-of',
22 )
23
Alexander Afanasyev08d18742018-03-15 16:31:28 -040024 bld.objects(
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080025 target='unit-tests-main',
26 source='main.cpp',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040027 defines=['BOOST_TEST_MODULE=NDNS Unit Tests', config_path],
28 use='ndns-objects')
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080029
Alexander Afanasyev08d18742018-03-15 16:31:28 -040030 bld.program(
Shock Jiang0b165f42014-10-24 09:08:09 -070031 target='../unit-tests',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040032 name='unit-tests',
33 source=bld.path.ant_glob('**/*.cpp', excl=['main.cpp']),
34 use='ndns-objects unit-tests-main',
Alexander Afanasyevfde570c2016-12-19 16:02:55 -080035 includes='../src .',
Shock Jiang0b165f42014-10-24 09:08:09 -070036 install_path=None,
Alexander Afanasyev08d18742018-03-15 16:31:28 -040037 defines=[config_path])