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 | 906dde5 | 2024-02-24 20:52:23 -0500 | [diff] [blame] | 6 | tmpdir = 'UNIT_TESTS_TMPDIR="%s"' % bld.bldnode.make_node('tests-tmp') |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 7 | |
Davide Pesavento | 550d8c9 | 2023-11-05 01:30:01 -0400 | [diff] [blame] | 8 | srcFiles = bld.path.ant_glob('**/*.cpp', |
| 9 | excl=['main.cpp', |
| 10 | '**/*-osx.t.cpp', |
| 11 | '**/*-sqlite3.t.cpp']) |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 12 | |
Davide Pesavento | 906dde5 | 2024-02-24 20:52:23 -0500 | [diff] [blame] | 13 | if bld.env.HAVE_OSX_FRAMEWORKS: |
Davide Pesavento | 7e78064 | 2018-11-24 15:51:34 -0500 | [diff] [blame] | 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 | |
Davide Pesavento | 906dde5 | 2024-02-24 20:52:23 -0500 | [diff] [blame] | 19 | # unit test objects |
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) |