blob: e91ac7fad7b9d482bca320450ee2a5d483e2c9b5 [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 Pesavento25d4f1c2020-04-29 23:31:04 -04003top = '../../'
Davide Pesavento7e780642018-11-24 15:51:34 -05004
5def 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 Pesavento25d4f1c2020-04-29 23:31:04 -040021 features='pch',
22 headers='unit-tests-pch.hpp',
Davide Pesavento7e780642018-11-24 15:51:34 -050023 use='tests-common',
24 defines=[configPath])
25
26 # unit test binary
Davide Pesavento25d4f1c2020-04-29 23:31:04 -040027 bld.program(target=top + 'unit-tests',
Davide Pesavento7e780642018-11-24 15:51:34 -050028 name='unit-tests',
29 source=['main.cpp'],
30 use='unit-tests-objects',
31 install_path=None)