blob: be93c0ac1496e072e9b3524fe3c2608890a81d59 [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='.',
Alexander Afanasyev9a0c2d02014-04-27 20:26:26 -070046 install_path=None,
Alexander Afanasyev613e2a92014-04-15 13:36:58 -070047 )
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',
Wentao Shang53df1632014-04-21 12:01:32 -070055 'daemon/face/unix-*.cpp',
56 'daemon/face/websocket-*.cpp']),
Alexander Afanasyev613e2a92014-04-15 13:36:58 -070057 use='daemon-objects unit-tests-main',
58 includes='.',
Alexander Afanasyev9a0c2d02014-04-27 20:26:26 -070059 install_path=None,
Alexander Afanasyev613e2a92014-04-15 13:36:58 -070060 )
61
62 if bld.env['HAVE_LIBPCAP']:
63 unit_tests_nfd.source += bld.path.ant_glob('daemon/face/ethernet.cpp')
64
65 if bld.env['HAVE_UNIX_SOCKETS']:
66 unit_tests_nfd.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
67
Wentao Shang53df1632014-04-21 12:01:32 -070068 if bld.env['HAVE_WEBSOCKET']:
69 unit_tests_nfd.source += bld.path.ant_glob('daemon/face/websocket-*.cpp')
70
Alexander Afanasyev3ecec502014-04-16 13:42:44 -070071 unit_tests_rib = bld.program(
72 target='../unit-tests-rib',
73 features='cxx cxxprogram',
74 source=bld.path.ant_glob(['rib/**/*.cpp']),
75 use='rib-objects unit-tests-main',
76 includes=['.'],
Alexander Afanasyev9a0c2d02014-04-27 20:26:26 -070077 install_path=None,
Alexander Afanasyev3ecec502014-04-16 13:42:44 -070078 )
79
Alexander Afanasyev613e2a92014-04-15 13:36:58 -070080 # Other tests (e.g., stress tests that can be enabled even if unit tests are disabled)
81 if bld.env['WITH_TESTS'] or bld.env['WITH_OTHER_TESTS']:
82 bld.recurse("other")