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; -*- |
Alexander Afanasyev | 4ffcff2 | 2014-09-02 15:39:20 -0700 | [diff] [blame] | 2 | top = '..' |
| 3 | |
| 4 | def build(bld): |
Davide Pesavento | bdd88c1 | 2020-11-26 00:35:08 -0500 | [diff] [blame] | 5 | if not bld.env.WITH_TESTS: |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 6 | return |
Alexander Afanasyev | 08d1874 | 2018-03-15 16:31:28 -0400 | [diff] [blame] | 7 | |
Davide Pesavento | bdd88c1 | 2020-11-26 00:35:08 -0500 | [diff] [blame] | 8 | tmpdir = bld.bldnode.make_node('tmp-files') |
| 9 | tmpdir.make_node('anchors').mkdir() |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 10 | |
Davide Pesavento | 28229df | 2020-01-04 15:11:25 -0500 | [diff] [blame] | 11 | bld(features='subst', |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 12 | name='test-validator-conf', |
| 13 | source='../validator.conf.sample.in', |
Davide Pesavento | bdd88c1 | 2020-11-26 00:35:08 -0500 | [diff] [blame] | 14 | target=tmpdir.make_node('validator.conf'), |
Davide Pesavento | d01c1a4 | 2019-01-21 21:42:45 -0500 | [diff] [blame] | 15 | ANCHORPATH='\"anchors/root.cert\"') |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 16 | |
Alexander Afanasyev | 08d1874 | 2018-03-15 16:31:28 -0400 | [diff] [blame] | 17 | bld.objects( |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 18 | target='unit-tests-main', |
| 19 | source='main.cpp', |
Alexander Afanasyev | 08d1874 | 2018-03-15 16:31:28 -0400 | [diff] [blame] | 20 | use='ndns-objects') |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 21 | |
Davide Pesavento | bdd88c1 | 2020-11-26 00:35:08 -0500 | [diff] [blame] | 22 | tmpdir_define = 'UNIT_TESTS_TMPDIR="%s"' % tmpdir |
Alexander Afanasyev | 08d1874 | 2018-03-15 16:31:28 -0400 | [diff] [blame] | 23 | bld.program( |
Shock Jiang | 0b165f4 | 2014-10-24 09:08:09 -0700 | [diff] [blame] | 24 | target='../unit-tests', |
Alexander Afanasyev | 08d1874 | 2018-03-15 16:31:28 -0400 | [diff] [blame] | 25 | name='unit-tests', |
| 26 | source=bld.path.ant_glob('**/*.cpp', excl=['main.cpp']), |
| 27 | use='ndns-objects unit-tests-main', |
Davide Pesavento | bdd88c1 | 2020-11-26 00:35:08 -0500 | [diff] [blame] | 28 | includes='.', |
| 29 | defines=[tmpdir_define], |
| 30 | install_path=None) |