blob: 624987466ba145d381ad412e0f0d5f7f0b4ef725 [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
Alexander Afanasyev4ffcff22014-09-02 15:39:20 -07003top = '..'
4
5def build(bld):
Shock Jiang0b165f42014-10-24 09:08:09 -07006 if not bld.env['WITH_TESTS']:
7 return
Alexander Afanasyev08d18742018-03-15 16:31:28 -04008
9 tmp_folder = bld.bldnode.make_node('tmp-files')
10 config_path = 'TEST_CONFIG_PATH="%s"' % tmp_folder
11 tmp_folder.make_node('anchors').mkdir()
Shock Jiang0b165f42014-10-24 09:08:09 -070012
Davide Pesavento28229df2020-01-04 15:11:25 -050013 bld(features='subst',
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080014 name='test-validator-conf',
15 source='../validator.conf.sample.in',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040016 target=tmp_folder.make_node('validator.conf'),
Davide Pesaventod01c1a42019-01-21 21:42:45 -050017 ANCHORPATH='\"anchors/root.cert\"')
Shock Jiang0b165f42014-10-24 09:08:09 -070018
Alexander Afanasyev08d18742018-03-15 16:31:28 -040019 bld.objects(
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080020 target='unit-tests-main',
21 source='main.cpp',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040022 use='ndns-objects')
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080023
Alexander Afanasyev08d18742018-03-15 16:31:28 -040024 bld.program(
Shock Jiang0b165f42014-10-24 09:08:09 -070025 target='../unit-tests',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040026 name='unit-tests',
27 source=bld.path.ant_glob('**/*.cpp', excl=['main.cpp']),
28 use='ndns-objects unit-tests-main',
Alexander Afanasyevfde570c2016-12-19 16:02:55 -080029 includes='../src .',
Shock Jiang0b165f42014-10-24 09:08:09 -070030 install_path=None,
Alexander Afanasyev08d18742018-03-15 16:31:28 -040031 defines=[config_path])