This repository has been archived by the owner on Mar 14, 2021. It is now read-only.
/
wscript
40 lines (36 loc) · 1.52 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# This file is part of the Ideal Library
# Copyright (C) 2011 Rafael Fernández López <ereslibre@ereslibre.es>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
import re
from waflib.Tools import waf_unit_test
def configure(conf):
conf.check_cfg(package = 'cppunit', args='--cflags --libs', mandatory = True)
def build(bld):
for unitTest in bld.path.ant_glob('*.cpp'):
unitTest = str(unitTest)
testName = re.match(r"^(.+Test)\.cpp$", unitTest)
if testName != None:
testName = testName.group(1)
bld(features = 'cxx cxxprogram test',
source = unitTest,
target = testName,
includes = '.. ../..',
install_path = None,
use = 'CPPUNIT IDEAL idealcore')
if bld.is_install or bld.options.all_tests:
bld.options.all_tests = True
bld.add_post_fun(waf_unit_test.summary)