blob: 423e5e3d323e4da48e312f09ec0396b03c7c0453 [file] [log] [blame]
Alexander Afanasyev613e2a92014-04-15 13:36:58 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3"""
4Copyright (c) 2014 Regents of the University of California,
5 Arizona Board of Regents,
6 Colorado State University,
7 University Pierre & Marie Curie, Sorbonne University,
8 Washington University in St. Louis,
9 Beijing Institute of Technology
10
11This file is part of NFD (Named Data Networking Forwarding Daemon).
12See AUTHORS.md for complete list of NFD authors and contributors.
13
14NFD is free software: you can redistribute it and/or modify it under the terms
15of the GNU General Public License as published by the Free Software Foundation,
16either version 3 of the License, or (at your option) any later version.
17
18NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20PURPOSE. See the GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License along with
23NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24"""
25
26top = '..'
27
28def build(bld):
29 # Unit tests
30 if bld.env['WITH_TESTS']:
31 unit_test_main = bld(
32 target='unit-tests-main',
33 name='unit-tests-main',
34 features='cxx',
35 source=bld.path.ant_glob(['*.cpp']),
36 use='core-objects',
37 )
38
39 # core tests
40 unit_tests_core = bld.program(
41 target='../unit-tests-core',
42 features='cxx cxxprogram',
43 source=bld.path.ant_glob(['core/**/*.cpp']),
44 use='core-objects unit-tests-main',
45 includes='.',
46 install_prefix=None,
47 )
48
49 # NFD tests
50 unit_tests_nfd = bld.program(
51 target='../unit-tests-daemon',
52 features='cxx cxxprogram',
53 source=bld.path.ant_glob(['daemon/**/*.cpp'],
54 excl=['daemon/face/ethernet.cpp',
55 'daemon/face/unix-*.cpp']),
56 use='daemon-objects unit-tests-main',
57 includes='.',
58 install_prefix=None,
59 )
60
61 if bld.env['HAVE_LIBPCAP']:
62 unit_tests_nfd.source += bld.path.ant_glob('daemon/face/ethernet.cpp')
63
64 if bld.env['HAVE_UNIX_SOCKETS']:
65 unit_tests_nfd.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
66
67 # Other tests (e.g., stress tests that can be enabled even if unit tests are disabled)
68 if bld.env['WITH_TESTS'] or bld.env['WITH_OTHER_TESTS']:
69 bld.recurse("other")