blob: 591353f20754a770a34b2e0c12708a6195370722 [file] [log] [blame]
Davide Pesavento7e780642018-11-24 15:51:34 -05001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
Davide Pesavento550d8c92023-11-05 01:30:01 -04003top = '../..'
Davide Pesavento7e780642018-11-24 15:51:34 -05004
5def build(bld):
Davide Pesavento906dde52024-02-24 20:52:23 -05006 tmpdir = 'UNIT_TESTS_TMPDIR="%s"' % bld.bldnode.make_node('tests-tmp')
Davide Pesavento7e780642018-11-24 15:51:34 -05007
Davide Pesavento550d8c92023-11-05 01:30:01 -04008 srcFiles = bld.path.ant_glob('**/*.cpp',
9 excl=['main.cpp',
10 '**/*-osx.t.cpp',
11 '**/*-sqlite3.t.cpp'])
Davide Pesavento7e780642018-11-24 15:51:34 -050012
Davide Pesavento906dde52024-02-24 20:52:23 -050013 if bld.env.HAVE_OSX_FRAMEWORKS:
Davide Pesavento7e780642018-11-24 15:51:34 -050014 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 Pesavento906dde52024-02-24 20:52:23 -050019 # unit test objects
Davide Pesavento550d8c92023-11-05 01:30:01 -040020 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 Pesavento7e780642018-11-24 15:51:34 -050027
28 # unit test binary
Davide Pesavento550d8c92023-11-05 01:30:01 -040029 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)