blob: a0b5c2e01a8208143ffbb6e621bb63dd35ea4894 [file] [log] [blame]
Alexander Afanasyev4ffcff22014-09-02 15:39:20 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
Alexander Afanasyev4ffcff22014-09-02 15:39:20 -07002top = '..'
3
4def build(bld):
Davide Pesaventobdd88c12020-11-26 00:35:08 -05005 if not bld.env.WITH_TESTS:
Shock Jiang0b165f42014-10-24 09:08:09 -07006 return
Alexander Afanasyev08d18742018-03-15 16:31:28 -04007
Davide Pesaventobdd88c12020-11-26 00:35:08 -05008 tmpdir = bld.bldnode.make_node('tmp-files')
9 tmpdir.make_node('anchors').mkdir()
Shock Jiang0b165f42014-10-24 09:08:09 -070010
Davide Pesavento28229df2020-01-04 15:11:25 -050011 bld(features='subst',
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080012 name='test-validator-conf',
13 source='../validator.conf.sample.in',
Davide Pesaventobdd88c12020-11-26 00:35:08 -050014 target=tmpdir.make_node('validator.conf'),
Davide Pesaventod01c1a42019-01-21 21:42:45 -050015 ANCHORPATH='\"anchors/root.cert\"')
Shock Jiang0b165f42014-10-24 09:08:09 -070016
Alexander Afanasyev08d18742018-03-15 16:31:28 -040017 bld.objects(
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080018 target='unit-tests-main',
19 source='main.cpp',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040020 use='ndns-objects')
Alexander Afanasyev7495a7e2014-11-20 19:21:27 -080021
Davide Pesaventobdd88c12020-11-26 00:35:08 -050022 tmpdir_define = 'UNIT_TESTS_TMPDIR="%s"' % tmpdir
Alexander Afanasyev08d18742018-03-15 16:31:28 -040023 bld.program(
Shock Jiang0b165f42014-10-24 09:08:09 -070024 target='../unit-tests',
Alexander Afanasyev08d18742018-03-15 16:31:28 -040025 name='unit-tests',
26 source=bld.path.ant_glob('**/*.cpp', excl=['main.cpp']),
27 use='ndns-objects unit-tests-main',
Davide Pesaventobdd88c12020-11-26 00:35:08 -050028 includes='.',
29 defines=[tmpdir_define],
30 install_path=None)