| # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| top = '..' |
| |
| def build(bld): |
| if not bld.env.WITH_TESTS: |
| return |
| |
| tmpdir = bld.bldnode.make_node('tmp-files') |
| tmpdir.make_node('anchors').mkdir() |
| |
| bld(features='subst', |
| name='test-validator-conf', |
| source='../validator.conf.sample.in', |
| target=tmpdir.make_node('validator.conf'), |
| ANCHORPATH='\"anchors/root.cert\"') |
| |
| bld.objects( |
| target='unit-tests-main', |
| source='main.cpp', |
| use='ndns-objects') |
| |
| tmpdir_define = 'UNIT_TESTS_TMPDIR="%s"' % tmpdir |
| bld.program( |
| target='../unit-tests', |
| name='unit-tests', |
| source=bld.path.ant_glob('**/*.cpp', excl=['main.cpp']), |
| use='ndns-objects unit-tests-main', |
| includes='.', |
| defines=[tmpdir_define], |
| install_path=None) |