blob: 6b4e2b881f3ed0949a1715bfe3415beeaa3d7c95 [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 Pesavento4c1ad4c2020-11-16 21:12:02 -05006 tmpdir = 'UNIT_TESTS_TMPDIR="%s"' % bld.bldnode.make_node('tmp-files')
Davide Pesavento7e780642018-11-24 15:51:34 -05007
8 # unit test objects
Davide Pesavento550d8c92023-11-05 01:30:01 -04009 srcFiles = bld.path.ant_glob('**/*.cpp',
10 excl=['main.cpp',
11 '**/*-osx.t.cpp',
12 '**/*-sqlite3.t.cpp'])
Davide Pesavento7e780642018-11-24 15:51:34 -050013
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 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)