Alexander Afanasyev | e83c056 | 2016-12-24 10:20:41 -0800 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
| 3 | top = '..' |
| 4 | |
| 5 | from waflib import Logs |
| 6 | |
| 7 | def build(bld): |
Alexander Afanasyev | a9369b4 | 2017-01-11 11:58:00 -0800 | [diff] [blame] | 8 | if not bld.env['WITH_TESTS']: |
| 9 | return |
| 10 | |
Alexander Afanasyev | e83c056 | 2016-12-24 10:20:41 -0800 | [diff] [blame] | 11 | bld(features='cxx', |
Lijing Wang | e0dd63e | 2015-05-31 16:25:16 -0700 | [diff] [blame] | 12 | target='tests-base', |
| 13 | name='tests-base', |
| 14 | source=bld.path.ant_glob(['*.cpp'], excl='main.cpp'), |
| 15 | use='core-objects', |
Alexander Afanasyev | 8495a4a | 2016-12-25 15:27:25 -0800 | [diff] [blame] | 16 | includes='.. .', |
Lijing Wang | e0dd63e | 2015-05-31 16:25:16 -0700 | [diff] [blame] | 17 | defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode) |
| 18 | ) |
Alexander Afanasyev | e83c056 | 2016-12-24 10:20:41 -0800 | [diff] [blame] | 19 | |
Lijing Wang | e0dd63e | 2015-05-31 16:25:16 -0700 | [diff] [blame] | 20 | 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 Afanasyev | e83c056 | 2016-12-24 10:20:41 -0800 | [diff] [blame] | 36 | install_path=None, |
Lijing Wang | e0dd63e | 2015-05-31 16:25:16 -0700 | [diff] [blame] | 37 | defines=['UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode)], |
Alexander Afanasyev | 8495a4a | 2016-12-25 15:27:25 -0800 | [diff] [blame] | 38 | includes='.. ../src .', |
Lijing Wang | e0dd63e | 2015-05-31 16:25:16 -0700 | [diff] [blame] | 39 | ) |