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 | 550d8c9 | 2023-11-05 01:30:01 -0400 | [diff] [blame^] | 3 | top = '../..' |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 4 | |
| 5 | def build(bld): |
Davide Pesavento | 4c1ad4c | 2020-11-16 21:12:02 -0500 | [diff] [blame] | 6 | tmpdir = 'UNIT_TESTS_TMPDIR="%s"' % bld.bldnode.make_node('tmp-files') |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 7 | |
| 8 | # unit test objects |
Davide Pesavento | 550d8c9 | 2023-11-05 01:30:01 -0400 | [diff] [blame^] | 9 | srcFiles = bld.path.ant_glob('**/*.cpp', |
| 10 | excl=['main.cpp', |
| 11 | '**/*-osx.t.cpp', |
| 12 | '**/*-sqlite3.t.cpp']) |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 13 | |
| 14 | if bld.env['HAVE_OSX_FRAMEWORKS']: |
| 15 | srcFiles += bld.path.ant_glob('**/*-osx.t.cpp') |
| 16 | |
| 17 | # In case we want to make it optional later |
| 18 | srcFiles += bld.path.ant_glob('**/*-sqlite3.t.cpp') |
| 19 | |
Davide Pesavento | 550d8c9 | 2023-11-05 01:30:01 -0400 | [diff] [blame^] | 20 | bld.objects( |
| 21 | target='unit-tests-objects', |
| 22 | source=srcFiles, |
| 23 | features='pch', |
| 24 | headers='unit-tests-pch.hpp', |
| 25 | use='tests-common', |
| 26 | defines=[tmpdir]) |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 27 | |
| 28 | # unit test binary |
Davide Pesavento | 550d8c9 | 2023-11-05 01:30:01 -0400 | [diff] [blame^] | 29 | bld.program( |
| 30 | target=f'{top}/unit-tests', |
| 31 | name='unit-tests', |
| 32 | source=['main.cpp'], |
| 33 | use='unit-tests-objects', |
| 34 | install_path=None) |