build: update waf to version 2.0.6
Major cleanup of all build scripts
Change-Id: I6904f034d40adc66366fdf08749900ffb31c68d9
diff --git a/tests/core/manager-base.t.cpp b/tests/core/manager-base.t.cpp
index 49f8b98..947727c 100644
--- a/tests/core/manager-base.t.cpp
+++ b/tests/core/manager-base.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -24,13 +24,13 @@
*/
#include "core/manager-base.hpp"
-#include "manager-common-fixture.hpp"
+#include "tests/manager-common-fixture.hpp"
+#include <ndn-cxx/mgmt/nfd/control-command.hpp>
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/pib/identity.hpp>
#include <ndn-cxx/security/pib/key.hpp>
#include <ndn-cxx/security/pib/pib.hpp>
-#include <ndn-cxx/mgmt/nfd/control-command.hpp>
namespace nfd {
namespace tests {
diff --git a/tests/daemon/face/generic-link-service.t.cpp b/tests/daemon/face/generic-link-service.t.cpp
index 3d803a1..dfb048c 100644
--- a/tests/daemon/face/generic-link-service.t.cpp
+++ b/tests/daemon/face/generic-link-service.t.cpp
@@ -26,8 +26,8 @@
#include "face/generic-link-service.hpp"
#include "face/face.hpp"
-#include "test-common.hpp"
#include "dummy-transport.hpp"
+#include "tests/test-common.hpp"
#include <ndn-cxx/lp/empty-value.hpp>
#include <ndn-cxx/lp/prefix-announcement.hpp>
diff --git a/tests/other/wscript b/tests/other/wscript
index 926ba9d..3c6d1c0 100644
--- a/tests/other/wscript
+++ b/tests/other/wscript
@@ -1,7 +1,6 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
"""
-Copyright (c) 2014-2016, Regents of the University of California,
+Copyright (c) 2014-2018, Regents of the University of California,
Arizona Board of Regents,
Colorado State University,
University Pierre & Marie Curie, Sorbonne University,
@@ -30,29 +29,21 @@
for module, name in {"cs-benchmark": "CS Benchmark",
"pit-fib-benchmark": "PIT & FIB Benchmark"}.items():
# main
- bld(target='unit-tests-%s-main' % module,
- name='unit-tests-%s-main' % module,
- features='cxx',
- source='../main.cpp',
- use='BOOST',
- defines=['BOOST_TEST_MODULE=%s' % name]
- )
-
+ bld.objects(target='other-tests-%s-main' % module,
+ source='../main.cpp',
+ use='BOOST',
+ defines=['BOOST_TEST_MODULE=%s' % name])
# module
- bld.program(target='../../%s' % module,
- features='cxx cxxprogram',
- source=bld.path.ant_glob(['%s*.cpp' % module]),
- use='daemon-objects unit-tests-base unit-tests-%s-main' % module,
- includes='.',
- install_path=None,
- defines=['UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % bld.bldnode]
- )
+ bld.program(name=module,
+ target='../../%s' % module,
+ source=bld.path.ant_glob('%s*.cpp' % module),
+ use='daemon-objects unit-tests-base other-tests-%s-main' % module,
+ defines=['UNIT_TEST_CONFIG_PATH="%s"' % bld.bldnode.make_node('tmp-files')],
+ install_path=None)
# face-benchmark does not rely on Boost.Test
- bld.program(target='../../face-benchmark',
- features='cxx cxxprogram',
- source=bld.path.ant_glob(['face-benchmark*.cpp']),
+ bld.program(name='face-benchmark',
+ target='../../face-benchmark',
+ source=bld.path.ant_glob('face-benchmark*.cpp'),
use='daemon-objects',
- includes='.',
- install_path=None
- )
+ install_path=None)
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index e141368..55ae1c8 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -24,9 +24,10 @@
*/
#include "rib/rib-manager.hpp"
-#include "manager-common-fixture.hpp"
#include "core/fib-max-depth.hpp"
+#include "tests/manager-common-fixture.hpp"
+
#include <ndn-cxx/lp/tags.hpp>
#include <ndn-cxx/mgmt/nfd/face-event-notification.hpp>
#include <ndn-cxx/mgmt/nfd/face-status.hpp>
diff --git a/tests/wscript b/tests/wscript
index 0ab7ec6..7e9300f 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -1,7 +1,6 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
"""
-Copyright (c) 2014-2016, Regents of the University of California,
+Copyright (c) 2014-2018, Regents of the University of California,
Arizona Board of Regents,
Colorado State University,
University Pierre & Marie Curie, Sorbonne University,
@@ -28,55 +27,49 @@
def build(bld):
# Unit tests
- if bld.env['WITH_TESTS']:
+ if bld.env.WITH_TESTS:
+ config_path = 'UNIT_TEST_CONFIG_PATH="%s"' % bld.bldnode.make_node('tmp-files')
- # common test modules
- unit_test_base = bld(
+ # common test objects
+ bld.objects(
target='unit-tests-base',
- name='unit-tests-base',
- features='cxx pch',
- source=bld.path.ant_glob(['*.cpp'], excl='main.cpp'),
+ features='pch',
+ source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
use='core-objects',
headers='../core/common.hpp boost-test.hpp',
- defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % bld.bldnode,
- )
+ defines=[config_path])
for module, name in {"core": "Core Tests",
"daemon": "Daemon Tests",
"rib": "RIB Tests",
"tools": "Tools Tests"}.items():
- # main()
- bld(target='unit-tests-%s-main' % module,
- name='unit-tests-%s-main' % module,
- features='cxx',
- use='BOOST',
- source='main.cpp',
- defines=['BOOST_TEST_MODULE=%s' % name]
- )
+ # main() for the module
+ bld.objects(target='unit-tests-%s-main' % module,
+ source='main.cpp',
+ use='BOOST',
+ defines=['BOOST_TEST_MODULE=%s' % name])
+
+ node = bld.path.find_dir(module)
+ src = node.ant_glob('**/*.cpp', excl=['face/*ethernet*.cpp',
+ 'face/pcap*.cpp',
+ 'face/unix*.cpp',
+ 'face/websocket*.cpp'])
+ if bld.env.HAVE_LIBPCAP:
+ src += node.ant_glob('face/*ethernet*.cpp')
+ src += node.ant_glob('face/pcap*.cpp')
+ if bld.env.HAVE_UNIX_SOCKETS:
+ src += node.ant_glob('face/unix*.cpp')
+ if bld.env.HAVE_WEBSOCKET:
+ src += node.ant_glob('face/websocket*.cpp')
# unit-tests-%module
- unit_tests = bld.program(
- target='../unit-tests-%s' % module,
- features='cxx cxxprogram',
- source=bld.path.ant_glob(['%s/**/*.cpp' % module],
- excl=['%s/**/ethernet*.cpp' % module,
- '%s/**/unix*.cpp' % module,
- '%s/**/websocket*.cpp' % module]),
- use='%s-objects unit-tests-base unit-tests-%s-main' % (module, module),
- includes='.',
- install_path=None,
- defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % bld.bldnode,
- )
+ bld.program(name='unit-tests-%s' % module,
+ target='../unit-tests-%s' % module,
+ source=src,
+ use='%s-objects unit-tests-base unit-tests-%s-main' % (module, module),
+ defines=[config_path],
+ install_path=None)
- if bld.env['HAVE_LIBPCAP']:
- unit_tests.source += bld.path.ant_glob('%s/**/ethernet*.cpp' % module)
-
- if bld.env['HAVE_UNIX_SOCKETS']:
- unit_tests.source += bld.path.ant_glob('%s/**/unix*.cpp' % module)
-
- if bld.env['HAVE_WEBSOCKET']:
- unit_tests.source += bld.path.ant_glob('%s/**/websocket*.cpp' % module)
-
- # 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")
+ # Other tests (e.g., stress tests and benchmarks that can be enabled even if unit tests are disabled)
+ if bld.env.WITH_TESTS or bld.env.WITH_OTHER_TESTS:
+ bld.recurse('other')