Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
Davide Pesavento | 25d4f1c | 2020-04-29 23:31:04 -0400 | [diff] [blame^] | 3 | top = '../../' |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 4 | |
| 5 | def build(bld): |
| 6 | configPath = 'UNIT_TEST_CONFIG_PATH="%s"' % bld.bldnode.make_node('tmp-files') |
| 7 | |
| 8 | # unit test objects |
| 9 | srcFiles = bld.path.ant_glob('**/*.cpp', excl=['main.cpp', |
| 10 | '**/*-osx.t.cpp', |
| 11 | '**/*-sqlite3.t.cpp']) |
| 12 | |
| 13 | if bld.env['HAVE_OSX_FRAMEWORKS']: |
| 14 | srcFiles += bld.path.ant_glob('**/*-osx.t.cpp') |
| 15 | |
| 16 | # In case we want to make it optional later |
| 17 | srcFiles += bld.path.ant_glob('**/*-sqlite3.t.cpp') |
| 18 | |
| 19 | bld.objects(target='unit-tests-objects', |
| 20 | source=srcFiles, |
Davide Pesavento | 25d4f1c | 2020-04-29 23:31:04 -0400 | [diff] [blame^] | 21 | features='pch', |
| 22 | headers='unit-tests-pch.hpp', |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 23 | use='tests-common', |
| 24 | defines=[configPath]) |
| 25 | |
| 26 | # unit test binary |
Davide Pesavento | 25d4f1c | 2020-04-29 23:31:04 -0400 | [diff] [blame^] | 27 | bld.program(target=top + 'unit-tests', |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 28 | name='unit-tests', |
| 29 | source=['main.cpp'], |
| 30 | use='unit-tests-objects', |
| 31 | install_path=None) |