blob: be93c0ac1496e072e9b3524fe3c2608890a81d59 [file] [log] [blame]
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
"""
Copyright (c) 2014 Regents of the University of California,
Arizona Board of Regents,
Colorado State University,
University Pierre & Marie Curie, Sorbonne University,
Washington University in St. Louis,
Beijing Institute of Technology
This file is part of NFD (Named Data Networking Forwarding Daemon).
See AUTHORS.md for complete list of NFD authors and contributors.
NFD is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
NFD 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with
NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
"""
top = '..'
def build(bld):
# Unit tests
if bld.env['WITH_TESTS']:
unit_test_main = bld(
target='unit-tests-main',
name='unit-tests-main',
features='cxx',
source=bld.path.ant_glob(['*.cpp']),
use='core-objects',
)
# core tests
unit_tests_core = bld.program(
target='../unit-tests-core',
features='cxx cxxprogram',
source=bld.path.ant_glob(['core/**/*.cpp']),
use='core-objects unit-tests-main',
includes='.',
install_path=None,
)
# NFD tests
unit_tests_nfd = bld.program(
target='../unit-tests-daemon',
features='cxx cxxprogram',
source=bld.path.ant_glob(['daemon/**/*.cpp'],
excl=['daemon/face/ethernet.cpp',
'daemon/face/unix-*.cpp',
'daemon/face/websocket-*.cpp']),
use='daemon-objects unit-tests-main',
includes='.',
install_path=None,
)
if bld.env['HAVE_LIBPCAP']:
unit_tests_nfd.source += bld.path.ant_glob('daemon/face/ethernet.cpp')
if bld.env['HAVE_UNIX_SOCKETS']:
unit_tests_nfd.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
if bld.env['HAVE_WEBSOCKET']:
unit_tests_nfd.source += bld.path.ant_glob('daemon/face/websocket-*.cpp')
unit_tests_rib = bld.program(
target='../unit-tests-rib',
features='cxx cxxprogram',
source=bld.path.ant_glob(['rib/**/*.cpp']),
use='rib-objects unit-tests-main',
includes=['.'],
install_path=None,
)
# Other tests (e.g., stress tests that can be enabled even if unit tests are disabled)
if bld.env['WITH_TESTS'] or bld.env['WITH_OTHER_TESTS']:
bld.recurse("other")