| # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| |
| top = '..' |
| |
| from waflib import Logs |
| |
| def build(bld): |
| if not bld.env['WITH_TESTS']: |
| return |
| |
| bld(features='cxx', |
| target='tests-base', |
| name='tests-base', |
| source=bld.path.ant_glob(['*.cpp'], excl='main.cpp'), |
| use='core-objects', |
| includes='.. .', |
| defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode) |
| ) |
| |
| for module, name in {"unit": "Unit Tests", |
| "integrated": "Integrated Tests"}.items(): |
| bld(target='%s-tests-main' % module, |
| name='%s-tests-main' % module, |
| features='cxx', |
| use='core-objects BOOST', |
| source='main.cpp', |
| defines=['BOOST_TEST_MODULE=%s' % name] |
| ) |
| |
| tests = bld.program( |
| target='../%s-tests' % module, |
| features='qt5 cxx cxxprogram', |
| moc='' if module == 'unit' else 'integrated-tests/fs-watcher.t.hpp', |
| source=bld.path.ant_glob(['%s-tests/*.cpp' % module]), |
| use='chronoshare core-objects fs-watcher tests-base %s-tests-main QT5CORE QT5WIDGETS' % module, |
| install_path=None, |
| defines=['UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode)], |
| includes='.. ../src .', |
| ) |