blob: e90076146fcb198792483159582023dbc3bad072 [file] [log] [blame]
Alexander Afanasyeve83c0562016-12-24 10:20:41 -08001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3top = '..'
4
5from waflib import Logs
6
7def build(bld):
Alexander Afanasyeva9369b42017-01-11 11:58:00 -08008 if not bld.env['WITH_TESTS']:
9 return
10
Alexander Afanasyeve83c0562016-12-24 10:20:41 -080011 bld(features='cxx',
Lijing Wange0dd63e2015-05-31 16:25:16 -070012 target='tests-base',
13 name='tests-base',
14 source=bld.path.ant_glob(['*.cpp'], excl='main.cpp'),
15 use='core-objects',
Alexander Afanasyev8495a4a2016-12-25 15:27:25 -080016 includes='.. .',
Lijing Wange0dd63e2015-05-31 16:25:16 -070017 defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode)
18 )
Alexander Afanasyeve83c0562016-12-24 10:20:41 -080019
Lijing Wange0dd63e2015-05-31 16:25:16 -070020 for module, name in {"unit": "Unit Tests",
21 "integrated": "Integrated Tests"}.items():
22 bld(target='%s-tests-main' % module,
23 name='%s-tests-main' % module,
24 features='cxx',
25 use='core-objects BOOST',
26 source='main.cpp',
27 defines=['BOOST_TEST_MODULE=%s' % name]
28 )
29
30 tests = bld.program(
31 target='../%s-tests' % module,
32 features='qt5 cxx cxxprogram',
33 moc='' if module == 'unit' else 'integrated-tests/fs-watcher.t.hpp',
34 source=bld.path.ant_glob(['%s-tests/*.cpp' % module]),
35 use='chronoshare core-objects fs-watcher tests-base %s-tests-main QT5CORE QT5WIDGETS' % module,
Alexander Afanasyeve83c0562016-12-24 10:20:41 -080036 install_path=None,
Lijing Wange0dd63e2015-05-31 16:25:16 -070037 defines=['UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode)],
Alexander Afanasyev8495a4a2016-12-25 15:27:25 -080038 includes='.. ../src .',
Lijing Wange0dd63e2015-05-31 16:25:16 -070039 )