build+ci: Upgrade build scripts, enable coverage and sanitizer flags

Change-Id: I825ea4fdf4f40c4af06b5667af432f1c0eab368d
This commit is contained in:
Alexander Afanasyev committed 2017-01-11 12:06:21 -08:00
1 parent 60d2588027
commit f3192eb789
19 files changed
+939 -216

No files matched your search

+6 -5
View File
@@ -1,9 +1,10 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
for i in `find "$DIR/.jenkins.d" -type f -perm +111 | sort`; do
echo "Run: $i"
$i
done
for file in "$DIR"/.jenkins.d/*; do
[[ -f $file && -x $file ]] || continue
echo "Run: $file"
"$file"
done
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "$JDIR"/util.sh
set -x
if has OSX $NODE_LABELS; then
brew update
brew upgrade
brew install boost pkg-config cryptopp openssl
brew cleanup
fi
if has Ubuntu $NODE_LABELS; then
sudo apt-get -qq update
sudo apt-get -qq install build-essential pkg-config libboost-all-dev \
libcrypto++-dev libsqlite3-dev libssl-dev
fi
+32 -28
View File
@@ -1,39 +1,43 @@
#!/usr/bin/env bash
set -x
set -e
cd /tmp
BUILD="no"
if [ ! -d ndn-cxx ]; then
git clone --depth 1 git://github.com/named-data/ndn-cxx
cd ndn-cxx
BUILD="yes"
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "$JDIR"/util.sh
set -x
pushd "${CACHE_DIR:-/tmp}" >/dev/null
INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
sudo rm -Rf ndn-cxx-latest
git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
sudo rm -Rf ndn-cxx
mv ndn-cxx-latest ndn-cxx
else
cd ndn-cxx
INSTALLED_VERSION=`git rev-parse HEAD || echo NONE`
sudo rm -Rf latest-version
git clone --depth 1 git://github.com/named-data/ndn-cxx latest-version
cd latest-version
LATEST_VERSION=`git rev-parse HEAD || echo UNKNOWN`
cd ..
rm -Rf latest-version
if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
cd ..
sudo rm -Rf ndn-cxx
git clone --depth 1 git://github.com/named-data/ndn-cxx
cd ndn-cxx
BUILD="yes"
fi
sudo rm -Rf ndn-cxx-latest
fi
sudo rm -Rf /usr/local/include/ndn-cxx
sudo rm -f /usr/local/lib/libndn-cxx*
sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
if [ "$BUILD" = "yes" ]; then
sudo ./waf distclean -j1 --color=yes
fi
pushd ndn-cxx >/dev/null
./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
./waf -j1 --color=yes
sudo ./waf install -j1 --color=yes
./waf -j1 --color=yes configure --enable-shared --disable-static --without-osx-keychain
./waf -j1 --color=yes build
sudo ./waf -j1 --color=yes install
popd >/dev/null
popd >/dev/null
if has Linux $NODE_LABELS; then
sudo ldconfig
elif has FreeBSD $NODE_LABELS; then
sudo ldconfig -a
fi
+39 -21
View File
@@ -1,32 +1,50 @@
#!/usr/bin/env bash
set -x
set -e
sudo rm -Rf /usr/local/include/ChronoSync
sudo rm -f /usr/local/lib/libChronoSync*
sudo rm -f /usr/local/lib/pkgconfig/ChronoSync*
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "$JDIR"/util.sh
set -x
git submodule init
git submodule sync
git submodule update
# Cleanup
sudo ./waf -j1 --color=yes distclean
# Configure/build in debug mode
./waf -j1 --color=yes configure --with-tests --debug
if [[ "$JOB_NAME" != *"limited-build" ]]; then
# Configure/build in optimized mode with tests
./waf -j1 --color=yes configure --with-tests
./waf -j1 --color=yes build
# Cleanup
sudo ./waf -j1 --color=yes distclean
# Configure/build in optimized mode without tests
./waf -j1 --color=yes configure
./waf -j1 --color=yes build
# Cleanup
sudo ./waf -j1 --color=yes distclean
fi
# Configure/build in debug mode with tests and without precompiled headers
if [[ "$JOB_NAME" == *"code-coverage" ]]; then
COVERAGE="--with-coverage"
elif ! has OSX-10.9 $NODE_LABELS && ! has OSX-10.11 $NODE_LABELS; then
ASAN="--with-sanitizer=address"
fi
./waf -j1 --color=yes configure --debug --with-tests --without-pch $COVERAGE $ASAN
./waf -j1 --color=yes build
# Cleanup
sudo ./waf -j1 --color=yes distclean
# Configure/build in optimized mode without tests
./waf -j1 --color=yes configure
./waf -j1 --color=yes build
# Cleanup
sudo ./waf -j1 --color=yes distclean
# Configure/build in optimized mode with tests
./waf -j1 --color=yes configure --with-tests
./waf -j1 --color=yes build
# (tests will be run against debug version)
# Install
sudo ./waf install -j1 --color=yes
sudo ldconfig || true
sudo ./waf -j1 --color=yes install
if has Linux $NODE_LABELS; then
sudo ldconfig
elif has FreeBSD $NODE_LABELS; then
sudo ldconfig -a
fi
+40 -4
View File
@@ -1,8 +1,44 @@
#!/usr/bin/env bash
set -x
set -e
# Prepare environment
sudo rm -Rf ~/.ndn
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "$JDIR"/util.sh
./build/unit-tests -l test_suite
set -x
# Prepare environment
rm -Rf ~/.ndn
if has OSX $NODE_LABELS; then
security unlock-keychain -p named-data
fi
ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
ut_log_args() {
if (( BOOST_VERSION >= 106200 )); then
echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
else
if [[ -n $XUNIT ]]; then
echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
--log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
else
echo --log_level=test_suite
fi
fi
}
ASAN_OPTIONS="color=always"
ASAN_OPTIONS+=":detect_leaks=false"
ASAN_OPTIONS+=":detect_stack_use_after_return=true"
ASAN_OPTIONS+=":check_initialization_order=true"
ASAN_OPTIONS+=":strict_init_order=true"
ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
ASAN_OPTIONS+=":detect_container_overflow=false"
ASAN_OPTIONS+=":strict_string_checks=true"
ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
export ASAN_OPTIONS
./build/unit-tests $(ut_log_args ChronoSync)
+18
View File
@@ -0,0 +1,18 @@
has() {
local saved_xtrace
[[ $- == *x* ]] && saved_xtrace=-x || saved_xtrace=+x
set +x
local p=$1
shift
local i ret=1
for i in "$@"; do
if [[ "${i}" == "${p}" ]]; then
ret=0
break
fi
done
set ${saved_xtrace}
return ${ret}
}
+22 -9
View File
@@ -1,15 +1,28 @@
# For Ubuntu platform only
language: cpp
os:
- linux
compiler:
- gcc
sudo: required
language: generic
env:
global:
- JOB_NAME=limited-build
matrix:
include:
- os: linux
dist: trusty
env:
- CXX=g++
- NODE_LABELS="Linux Ubuntu Ubuntu-14.04"
- os: linux
dist: trusty
env:
- CXX=clang++
- NODE_LABELS="Linux Ubuntu Ubuntu-14.04"
- os: osx
osx_image: xcode8.2
env:
- CXX=clang++
- NODE_LABELS="OSX OSX-10.12"
notifications:
email:
on_success: always
on_failure: always
before_install:
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install -qq libssl-dev libprotobuf-dev protobuf-compiler libboost1.48-all-dev libcrypto++-dev libsqlite3-dev
script:
- ./.jenkins
+216 -76
View File
@@ -30,15 +30,15 @@ When using this tool, the wscript will look like:
Options are generated, in order to specify the location of boost includes/libraries.
The `check_boost` configuration function allows to specify the used boost libraries.
It can also provide default arguments to the --boost-static and --boost-mt command-line arguments.
It can also provide default arguments to the --boost-mt command-line arguments.
Everything will be packaged together in a BOOST component that you can use.
When using MSVC, a lot of compilation flags need to match your BOOST build configuration:
- you may have to add /EHsc to your CXXFLAGS or define boost::throw_exception if BOOST_NO_EXCEPTIONS is defined.
Errors: C4530
- boost libraries will try to be smart and use the (pretty but often not useful) auto-linking feature of MSVC
So before calling `conf.check_boost` you might want to disabling by adding:
conf.env.DEFINES_BOOST += ['BOOST_ALL_NO_LIB']
So before calling `conf.check_boost` you might want to disabling by adding
conf.env.DEFINES_BOOST += ['BOOST_ALL_NO_LIB']
Errors:
- boost might also be compiled with /MT, which links the runtime statically.
If you have problems with redefined symbols,
@@ -52,24 +52,55 @@ import sys
import re
from waflib import Utils, Logs, Errors
from waflib.Configure import conf
from waflib.TaskGen import feature, after_method
BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib', '/usr/lib/x86_64-linux-gnu', '/usr/lib/i386-linux-gnu', '/usr/local/ndn/lib']
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include', '/usr/local/ndn/include']
BOOST_LIBS = ['/usr/lib/x86_64-linux-gnu', '/usr/lib/i386-linux-gnu',
'/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib']
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include']
BOOST_VERSION_FILE = 'boost/version.hpp'
BOOST_VERSION_CODE = '''
#include <iostream>
#include <boost/version.hpp>
int main() { std::cout << BOOST_LIB_VERSION << ":" << BOOST_VERSION << std::endl; }
'''
BOOST_SYSTEM_CODE = '''
BOOST_ERROR_CODE = '''
#include <boost/system/error_code.hpp>
int main() { boost::system::error_code c; }
'''
PTHREAD_CODE = '''
#include <pthread.h>
static void* f(void*) { return 0; }
int main() {
pthread_t th;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_create(&th, &attr, &f, 0);
pthread_join(th, 0);
pthread_cleanup_push(0, 0);
pthread_cleanup_pop(0);
pthread_attr_destroy(&attr);
}
'''
BOOST_THREAD_CODE = '''
#include <boost/thread.hpp>
int main() { boost::thread t; }
'''
BOOST_LOG_CODE = '''
#include <boost/log/trivial.hpp>
#include <boost/log/utility/setup/console.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
int main() {
using namespace boost::log;
add_common_attributes();
add_console_log(std::clog, keywords::format = "%Message%");
BOOST_LOG_TRIVIAL(debug) << "log is working" << std::endl;
}
'''
# toolsets from {boost_dir}/tools/build/v2/tools/common.jam
PLATFORM = Utils.unversioned_sys_platform()
detect_intel = lambda env: (PLATFORM == 'win32') and 'iw' or 'il'
@@ -101,34 +132,37 @@ BOOST_TOOLSETS = {
def options(opt):
opt = opt.add_option_group('Boost Options')
opt.add_option('--boost-includes', type='string',
default='', dest='boost_includes',
help='''path to the directory where the boost includes are, e.g., /path/to/boost_1_55_0/stage/include''')
help='''path to the directory where the boost includes are,
e.g., /path/to/boost_1_55_0/stage/include''')
opt.add_option('--boost-libs', type='string',
default='', dest='boost_libs',
help='''path to the directory where the boost libs are, e.g., /path/to/boost_1_55_0/stage/lib''')
opt.add_option('--boost-static', action='store_true',
default=False, dest='boost_static',
help='link with static boost libraries (.lib/.a)')
help='''path to the directory where the boost libs are,
e.g., path/to/boost_1_55_0/stage/lib''')
opt.add_option('--boost-mt', action='store_true',
default=False, dest='boost_mt',
help='select multi-threaded libraries')
opt.add_option('--boost-abi', type='string', default='', dest='boost_abi',
help='''select libraries with tags (dgsyp, d for debug), see doc Boost, Getting Started, chapter 6.1''')
help='''select libraries with tags (gd for debug, static is automatically added),
see doc Boost, Getting Started, chapter 6.1''')
opt.add_option('--boost-linkage_autodetect', action="store_true", dest='boost_linkage_autodetect',
help="auto-detect boost linkage options (don't get used to it / might break other stuff)")
opt.add_option('--boost-toolset', type='string',
default='', dest='boost_toolset',
help='force a toolset e.g. msvc, vc90, gcc, mingw, mgw45 (default: auto)')
help='force a toolset e.g. msvc, vc90, \
gcc, mingw, mgw45 (default: auto)')
py_version = '%d%d' % (sys.version_info[0], sys.version_info[1])
opt.add_option('--boost-python', type='string',
default=py_version, dest='boost_python',
help='select the lib python with this version (default: %s)' % py_version)
help='select the lib python with this version \
(default: %s)' % py_version)
@conf
def __boost_get_version_file(self, d):
if not d:
return None
dnode = self.root.find_dir(d)
if dnode:
return dnode.find_node(BOOST_VERSION_FILE)
@@ -141,18 +175,15 @@ def boost_get_version(self, d):
if node:
try:
txt = node.read()
except (OSError, IOError):
except EnvironmentError:
Logs.error("Could not read the file %r" % node.abspath())
else:
re_but1 = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.+)"', re.M)
m1 = re_but1.search(txt)
re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+(\\d+)', re.M)
m2 = re_but2.search(txt)
if m1 and m2:
return (m1.group(1), m2.group(1))
return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True).split(":")
@conf
@@ -160,7 +191,7 @@ def boost_get_includes(self, *k, **kw):
includes = k and k[0] or kw.get('includes', None)
if includes and self.__boost_get_version_file(includes):
return includes
for d in Utils.to_list(self.environ.get('INCLUDE', '')) + BOOST_INCLUDES:
for d in self.environ.get('INCLUDE', '').split(';') + BOOST_INCLUDES:
if self.__boost_get_version_file(d):
return d
if includes:
@@ -195,7 +226,9 @@ def __boost_get_libs_path(self, *k, **kw):
path = self.root.find_dir(libs)
files = path.ant_glob('*boost_*')
if not libs or not files:
for d in Utils.to_list(self.environ.get('LIB', [])) + BOOST_LIBS:
for d in self.environ.get('LIB', '').split(';') + BOOST_LIBS:
if not d:
continue
path = self.root.find_dir(d)
if path:
files = path.ant_glob('*boost_*')
@@ -226,15 +259,10 @@ def boost_get_libs(self, *k, **kw):
according to the parameters
'''
path, files = self.__boost_get_libs_path(**kw)
t = []
if kw.get('mt', False):
t.append('mt')
if kw.get('abi', None):
t.append(kw['abi'])
tags = t and '(-%s)+' % '-'.join(t) or ''
files = sorted(files, key=lambda f: (len(f.name), f.name), reverse=True)
toolset = self.boost_get_toolset(kw.get('toolset', ''))
toolset_pat = '(-%s[0-9]{0,3})+' % toolset
version = '(-%s)+' % self.env.BOOST_VERSION
toolset_pat = '(-%s[0-9]{0,3})' % toolset
version = '-%s' % self.env.BOOST_VERSION
def find_lib(re_lib, files):
for file in files:
@@ -248,28 +276,110 @@ def boost_get_libs(self, *k, **kw):
name = name[3:]
return name[:name.rfind('.')]
libs = []
for lib in Utils.to_list(k and k[0] or kw.get('lib', None)):
py = (lib == 'python') and '(-py%s)+' % kw['python'] or ''
# Trying libraries, from most strict match to least one
for pattern in ['boost_%s%s%s%s%s' % (lib, toolset_pat, tags, py, version),
'boost_%s%s%s%s' % (lib, tags, py, version),
'boost_%s%s%s' % (lib, tags, version),
# Give up trying to find the right version
'boost_%s%s%s%s' % (lib, toolset_pat, tags, py),
'boost_%s%s%s' % (lib, tags, py),
'boost_%s%s' % (lib, tags)]:
self.to_log('Trying pattern %s' % pattern)
file = find_lib(re.compile(pattern), files)
if file:
libs.append(format_lib_name(file.name))
break
else:
self.end_msg('lib %s not found in %s' % (lib, path.abspath()))
self.fatal('The configuration failed')
def match_libs(lib_names, is_static):
libs = []
lib_names = Utils.to_list(lib_names)
if not lib_names:
return libs
t = []
if kw.get('mt', False):
t.append('-mt')
if kw.get('abi', None):
t.append('%s%s' % (is_static and '-s' or '-', kw['abi']))
elif is_static:
t.append('-s')
tags_pat = t and ''.join(t) or ''
ext = is_static and self.env.cxxstlib_PATTERN or self.env.cxxshlib_PATTERN
ext = ext.partition('%s')[2] # remove '%s' or 'lib%s' from PATTERN
return path.abspath(), libs
for lib in lib_names:
if lib == 'python':
# for instance, with python='27',
# accepts '-py27', '-py2', '27' and '2'
# but will reject '-py3', '-py26', '26' and '3'
tags = '({0})?((-py{2})|(-py{1}(?=[^0-9]))|({2})|({1}(?=[^0-9]))|(?=[^0-9])(?!-py))'.format(tags_pat, kw['python'][0], kw['python'])
else:
tags = tags_pat
# Trying libraries, from most strict match to least one
for pattern in ['boost_%s%s%s%s%s$' % (lib, toolset_pat, tags, version, ext),
'boost_%s%s%s%s$' % (lib, tags, version, ext),
# Give up trying to find the right version
'boost_%s%s%s%s$' % (lib, toolset_pat, tags, ext),
'boost_%s%s%s$' % (lib, tags, ext),
'boost_%s%s$' % (lib, ext),
'boost_%s' % lib]:
self.to_log('Trying pattern %s' % pattern)
file = find_lib(re.compile(pattern), files)
if file:
libs.append(format_lib_name(file.name))
break
else:
self.end_msg('lib %s not found in %s' % (lib, path.abspath()))
self.fatal('The configuration failed')
return libs
return path.abspath(), match_libs(kw.get('lib', None), False), match_libs(kw.get('stlib', None), True)
@conf
def _check_pthread_flag(self, *k, **kw):
'''
Computes which flags should be added to CXXFLAGS and LINKFLAGS to compile in multi-threading mode
Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
boost/thread.hpp will trigger a #error if -pthread isn't used:
boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
is not turned on. Please set the correct command line options for
threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
Based on _BOOST_PTHREAD_FLAG(): https://github.com/tsuna/boost.m4/blob/master/build-aux/boost.m4
'''
var = kw.get('uselib_store', 'BOOST')
self.start_msg('Checking the flags needed to use pthreads')
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# (none): in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -lpthreads: AIX (must check this before -lpthread)
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
# -pthreads: Solaris/GCC
# -mthreads: MinGW32/GCC, Lynx/GCC
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# -lpthread: GNU Linux, etc.
# --thread-safe: KAI C++
if Utils.unversioned_sys_platform() == "sunos":
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
boost_pthread_flags = ["-pthreads", "-lpthread", "-mt", "-pthread"]
else:
boost_pthread_flags = ["", "-lpthreads", "-Kthread", "-kthread", "-llthread", "-pthread",
"-pthreads", "-mthreads", "-lpthread", "--thread-safe", "-mt"]
for boost_pthread_flag in boost_pthread_flags:
try:
self.env.stash()
self.env['CXXFLAGS_%s' % var] += [boost_pthread_flag]
self.env['LINKFLAGS_%s' % var] += [boost_pthread_flag]
self.check_cxx(code=PTHREAD_CODE, msg=None, use=var, execute=False)
self.end_msg(boost_pthread_flag)
return
except self.errors.ConfigurationError:
self.env.revert()
self.end_msg('None')
@conf
def check_boost(self, *k, **kw):
@@ -282,7 +392,10 @@ def check_boost(self, *k, **kw):
if not self.env['CXX']:
self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
params = {'lib': k and k[0] or kw.get('lib', None)}
params = {
'lib': k and k[0] or kw.get('lib', None),
'stlib': kw.get('stlib', None)
}
for key, value in self.options.__dict__.items():
if not key.startswith('boost_'):
continue
@@ -297,42 +410,53 @@ def check_boost(self, *k, **kw):
self.env.BOOST_VERSION = versions[0]
self.env.BOOST_VERSION_NUMBER = int(versions[1])
self.end_msg("%d.%d.%d" % (int(versions[1]) / 100000,
int(versions[1]) / 100 % 1000,
int(versions[1]) % 100))
int(versions[1]) / 100 % 1000,
int(versions[1]) % 100))
if Logs.verbose:
Logs.pprint('CYAN', ' path : %s' % self.env['INCLUDES_%s' % var])
if not params['lib']:
if not params['lib'] and not params['stlib']:
return
if 'static' in kw or 'static' in params:
Logs.warn('boost: static parameter is deprecated, use stlib instead.')
self.start_msg('Checking boost libs')
suffix = params.get('static', None) and 'ST' or ''
path, libs = self.boost_get_libs(**params)
self.env['%sLIBPATH_%s' % (suffix, var)] = [path]
self.env['%sLIB_%s' % (suffix, var)] = libs
path, libs, stlibs = self.boost_get_libs(**params)
self.env['LIBPATH_%s' % var] = [path]
self.env['STLIBPATH_%s' % var] = [path]
self.env['LIB_%s' % var] = libs
self.env['STLIB_%s' % var] = stlibs
self.end_msg('ok')
if Logs.verbose:
Logs.pprint('CYAN', ' path : %s' % path)
Logs.pprint('CYAN', ' libs : %s' % libs)
Logs.pprint('CYAN', ' shared libs : %s' % libs)
Logs.pprint('CYAN', ' static libs : %s' % stlibs)
def has_shlib(lib):
return params['lib'] and lib in params['lib']
def has_stlib(lib):
return params['stlib'] and lib in params['stlib']
def has_lib(lib):
return has_shlib(lib) or has_stlib(lib)
if has_lib('thread'):
# not inside try_link to make check visible in the output
self._check_pthread_flag(k, kw)
def try_link():
if 'system' in params['lib']:
self.check_cxx(
fragment=BOOST_SYSTEM_CODE,
use=var,
execute=False,
)
if 'thread' in params['lib']:
self.check_cxx(
fragment=BOOST_THREAD_CODE,
use=var,
execute=False,
)
if has_lib('system'):
self.check_cxx(fragment=BOOST_ERROR_CODE, use=var, execute=False)
if has_lib('thread'):
self.check_cxx(fragment=BOOST_THREAD_CODE, use=var, execute=False)
if has_lib('log'):
if not has_lib('thread'):
self.env['DEFINES_%s' % var] += ['BOOST_LOG_NO_THREADS']
if has_shlib('log'):
self.env['DEFINES_%s' % var] += ['BOOST_LOG_DYN_LINK']
self.check_cxx(fragment=BOOST_LOG_CODE, use=var, execute=False)
if params.get('linkage_autodetect', False):
self.start_msg("Attempting to detect boost linkage flags")
toolset = self.boost_get_toolset(kw.get('toolset', ''))
if toolset in ['vc']:
if toolset in ('vc',):
# disable auto-linking feature, causing error LNK1181
# because the code wants to be linked against
self.env['DEFINES_%s' % var] += ['BOOST_ALL_NO_LIB']
@@ -356,14 +480,14 @@ def check_boost(self, *k, **kw):
try:
try_link()
self.end_msg("ok: winning cxxflags combination: %s" % (self.env["CXXFLAGS_%s" % var]))
e = None
exc = None
break
except Errors.ConfigurationError as exc:
except Errors.ConfigurationError as e:
self.env.revert()
e = exc
exc = e
if e is not None:
self.end_msg("Could not auto-detect boost linking flags combination, you may report it to boost.py author", ex=e)
if exc is not None:
self.end_msg("Could not auto-detect boost linking flags combination, you may report it to boost.py author", ex=exc)
self.fatal('The configuration failed')
else:
self.end_msg("Boost linkage flags auto-detection not implemented (needed ?) for this toolchain")
@@ -376,3 +500,19 @@ def check_boost(self, *k, **kw):
self.end_msg("Could not link against boost libraries using supplied options")
self.fatal('The configuration failed')
self.end_msg('ok')
@feature('cxx')
@after_method('apply_link')
def install_boost(self):
if install_boost.done or not Utils.is_win32 or not self.bld.cmd.startswith('install'):
return
install_boost.done = True
inst_to = getattr(self, 'install_path', '${BINDIR}')
for lib in self.env.LIB_BOOST:
try:
file = self.bld.find_file(self.env.cxxshlib_PATTERN % lib, self.env.LIBPATH_BOOST)
self.bld.install_files(inst_to, self.bld.root.find_node(file))
except:
continue
install_boost.done = False
+22
View File
@@ -0,0 +1,22 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
from waflib import TaskGen, Logs
def options(opt):
opt.add_option('--with-coverage', action='store_true', default=False, dest='with_coverage',
help='''Set compiler flags for gcc to enable code coverage information''')
def configure(conf):
if conf.options.with_coverage:
if not conf.options.debug:
conf.fatal("Code coverage flags require debug mode compilation (add --debug)")
conf.check_cxx(cxxflags=['-fprofile-arcs', '-ftest-coverage', '-fPIC'],
linkflags=['-fprofile-arcs'], uselib_store='GCOV', mandatory=True)
@TaskGen.feature('cxx','cc')
@TaskGen.after('process_source')
def add_coverage(self):
if getattr(self, 'use', ''):
self.use += ' GCOV'
else:
self.use = 'GCOV'
+137 -30
View File
@@ -1,53 +1,57 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014, Regents of the University of California
#
# GPL 3.0 license, see the COPYING.md file for more information
from waflib import Logs, Configure
from waflib import Logs, Configure, Utils
def options(opt):
opt.add_option('--debug', '--with-debug', action='store_true', default=False, dest='debug',
help='''Compile in debugging mode without all optimizations (-O0)''')
help='''Compile in debugging mode without optimizations (-O0 or -Og)''')
def configure(conf):
areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
defaultFlags = ['-std=c++0x', '-std=c++11',
'-stdlib=libc++', # clang on OSX < 10.9 by default uses gcc's
# libstdc++, which is not C++11 compatible
'-Wall', '-Wno-long-long', '-Wno-nested-anon-types']
cxx = conf.env['CXX_NAME'] # CXX_NAME represents generic name of the compiler
if cxx == 'gcc':
flags = GccFlags()
elif cxx == 'clang':
flags = ClangFlags()
else:
flags = CompilerFlags()
Logs.warn('The code has not yet been tested with %s compiler' % cxx)
areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
# General flags are always applied (e.g., selecting C++11 mode)
generalFlags = flags.getGeneralFlags(conf)
conf.add_supported_cxxflags(generalFlags['CXXFLAGS'])
conf.add_supported_linkflags(generalFlags['LINKFLAGS'])
conf.env.DEFINES += generalFlags['DEFINES']
# Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the
# corresponding environment variables are not set.
# DEFINES are always applied.
if conf.options.debug:
conf.define('_DEBUG', 1)
defaultFlags += ['-O0',
'-Og', # gcc >= 4.8
'-g3',
'-fcolor-diagnostics', # clang
'-fdiagnostics-color', # gcc >= 4.9
'-Wno-error=maybe-uninitialized', # Bug #1560
'-Wno-unneeded-internal-declaration',
]
extraFlags = flags.getDebugFlags(conf)
if areCustomCxxflagsPresent:
missingFlags = [x for x in defaultFlags if x not in conf.env.CXXFLAGS]
missingFlags = [x for x in extraFlags['CXXFLAGS'] if x not in conf.env.CXXFLAGS]
if len(missingFlags) > 0:
Logs.warn("Selected debug mode, but CXXFLAGS is set to a custom value '%s'"
% " ".join(conf.env.CXXFLAGS))
Logs.warn("Default flags '%s' are not activated" % " ".join(missingFlags))
else:
conf.add_supported_cxxflags(defaultFlags)
else:
defaultFlags += ['-O2', '-g']
if not areCustomCxxflagsPresent:
conf.add_supported_cxxflags(defaultFlags)
extraFlags = flags.getOptimizedFlags(conf)
# clang on OSX < 10.9 by default uses gcc's libstdc++, which is not C++11 compatible
conf.add_supported_linkflags(['-stdlib=libc++'])
if not areCustomCxxflagsPresent:
conf.add_supported_cxxflags(extraFlags['CXXFLAGS'])
conf.add_supported_linkflags(extraFlags['LINKFLAGS'])
conf.env.DEFINES += extraFlags['DEFINES']
@Configure.conf
def add_supported_cxxflags(self, cxxflags):
"""
Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
"""
if len(cxxflags) == 0:
return
self.start_msg('Checking supported CXXFLAGS')
supportedFlags = []
@@ -56,13 +60,16 @@ def add_supported_cxxflags(self, cxxflags):
supportedFlags += [flag]
self.end_msg(' '.join(supportedFlags))
self.env.CXXFLAGS = supportedFlags + self.env.CXXFLAGS
self.env.prepend_value('CXXFLAGS', supportedFlags)
@Configure.conf
def add_supported_linkflags(self, linkflags):
"""
Check which linkflags are supported by compiler and add them to env.LINKFLAGS variable
"""
if len(linkflags) == 0:
return
self.start_msg('Checking supported LINKFLAGS')
supportedFlags = []
@@ -71,4 +78,104 @@ def add_supported_linkflags(self, linkflags):
supportedFlags += [flag]
self.end_msg(' '.join(supportedFlags))
self.env.LINKFLAGS = supportedFlags + self.env.LINKFLAGS
self.env.prepend_value('LINKFLAGS', supportedFlags)
class CompilerFlags(object):
def getGeneralFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
def getDebugFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['_DEBUG']}
def getOptimizedFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']}
class GccBasicFlags(CompilerFlags):
"""
This class defines basic flags that work for both gcc and clang compilers
"""
def getDebugFlags(self, conf):
flags = super(GccBasicFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-O0',
'-g3',
'-pedantic',
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unused-parameter',
'-Wno-error=maybe-uninitialized', # Bug #1615
'-Wno-error=deprecated-declarations', # Bug #3795
]
return flags
def getOptimizedFlags(self, conf):
flags = super(GccBasicFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-O2',
'-g',
'-pedantic',
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
]
return flags
class GccFlags(GccBasicFlags):
def getGeneralFlags(self, conf):
flags = super(GccFlags, self).getGeneralFlags(conf)
version = tuple(int(i) for i in conf.env['CC_VERSION'])
if version < (4, 8, 2):
conf.fatal('The version of gcc you are using (%s) is too old.\n' %
'.'.join(conf.env['CC_VERSION']) +
'The minimum supported gcc version is 4.8.2.')
else:
flags['CXXFLAGS'] += ['-std=c++11']
return flags
def getDebugFlags(self, conf):
flags = super(GccFlags, self).getDebugFlags(conf)
version = tuple(int(i) for i in conf.env['CC_VERSION'])
if version < (5, 1, 0):
flags['CXXFLAGS'] += ['-Wno-missing-field-initializers']
flags['CXXFLAGS'] += ['-Og', # gcc >= 4.8
'-fdiagnostics-color', # gcc >= 4.9
]
return flags
def getOptimizedFlags(self, conf):
flags = super(GccFlags, self).getOptimizedFlags(conf)
version = tuple(int(i) for i in conf.env['CC_VERSION'])
if version < (5, 1, 0):
flags['CXXFLAGS'] += ['-Wno-missing-field-initializers']
flags['CXXFLAGS'] += ['-fdiagnostics-color'] # gcc >= 4.9
return flags
class ClangFlags(GccBasicFlags):
def getGeneralFlags(self, conf):
flags = super(ClangFlags, self).getGeneralFlags(conf)
flags['CXXFLAGS'] += ['-std=c++11']
if Utils.unversioned_sys_platform() == 'darwin':
flags['CXXFLAGS'] += ['-stdlib=libc++']
flags['LINKFLAGS'] += ['-stdlib=libc++']
return flags
def getDebugFlags(self, conf):
flags = super(ClangFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
'-Wno-error=unneeded-internal-declaration', # Bug #1588
'-Wno-error=deprecated-register',
'-Wno-error=keyword-macro', # Bug #3235
'-Wno-error=infinite-recursion', # Bug #3358
]
return flags
def getOptimizedFlags(self, conf):
flags = super(ClangFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
return flags
+1 -1
View File
@@ -85,7 +85,7 @@ class doxygen(Task.Task):
# Override with any parameters passed to the task generator
if getattr(self.generator, 'pars', None):
for k, v in self.generator.pars.iteritems():
for k, v in self.generator.pars.items():
self.pars[k] = v
self.doxy_inputs = getattr(self, 'doxy_inputs', [])
+5
View File
@@ -67,6 +67,11 @@ def options(opt):
def configure(conf):
if (conf.options.with_pch and conf.env['COMPILER_CXX'] in PCH_COMPILER_OPTIONS.keys()):
if Utils.unversioned_sys_platform() == "darwin" and conf.env['CXX_NAME'] == 'clang':
version = tuple(int(i) for i in conf.env['CC_VERSION'])
if version < (6, 1, 0):
# Issue #2804
return
conf.env.WITH_PCH = True
flags = PCH_COMPILER_OPTIONS[conf.env['COMPILER_CXX']]
conf.env.CXXPCH_F = flags[0]
+22
View File
@@ -0,0 +1,22 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def options(opt):
opt.add_option('--with-sanitizer', action='store', default='', dest='sanitizers',
help='Comma-separated list of compiler sanitizers to enable [default=none]')
def configure(conf):
for san in conf.options.sanitizers.split(','):
if not san:
continue
sanflag = '-fsanitize=%s' % san
conf.start_msg('Checking if compiler supports %s' % sanflag)
if conf.check_cxx(cxxflags=['-Werror', sanflag, '-fno-omit-frame-pointer'],
linkflags=[sanflag], mandatory=False):
conf.end_msg('yes')
conf.env.append_unique('CXXFLAGS', [sanflag, '-fno-omit-frame-pointer'])
conf.env.append_unique('LINKFLAGS', [sanflag])
else:
conf.end_msg('no', color='RED')
conf.fatal('%s sanitizer is not supported by the current compiler' % san)
+8 -8
View File
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2014 University of California, Los Angeles
* Copyright (c) 2012-2017 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -48,12 +48,12 @@
#else // HAVE_LOG4CXX
#define INIT_LOGGER(name)
#define _LOG_FUNCTION(x)
#define _LOG_FUNCTION_NOARGS
#define _LOG_TRACE(x)
#define INIT_LOGGERS(x)
#define _LOG_ERROR(x)
#define INIT_LOGGER(name) struct chronosync__allow_trailing_semicolon
#define _LOG_FUNCTION(x) struct chronosync__allow_trailing_semicolon
#define _LOG_FUNCTION_NOARGS struct chronosync__allow_trailing_semicolon
#define _LOG_TRACE(x) struct chronosync__allow_trailing_semicolon
#define INIT_LOGGERS(x) struct chronosync__allow_trailing_semicolon
#define _LOG_ERROR(x) struct chronosync__allow_trailing_semicolon
#ifdef _DEBUG
@@ -67,7 +67,7 @@
#else // _DEBUG
#define _LOG_DEBUG(x)
#define _LOG_DEBUG(x) struct chronosync__allow_trailing_semicolon
#endif // _DEBUG
+214
View File
@@ -0,0 +1,214 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2015 Regents of the University of California.
*
* Based on work by Martin Ba (http://stackoverflow.com/a/26718189)
*
* This file is distributed under the Boost Software License, Version 1.0.
* (See http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
#define NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
#include <boost/version.hpp>
#if BOOST_VERSION >= 105900
#include <boost/test/unit_test_parameters.hpp>
#else
#include <boost/test/detail/unit_test_parameters.hpp>
#endif // BOOST_VERSION >= 105900
#include <boost/test/unit_test_log_formatter.hpp>
#include <boost/test/output/compiler_log_formatter.hpp>
#include <boost/test/output/xml_log_formatter.hpp>
namespace boost {
namespace unit_test {
namespace output {
/**
* @brief Log formatter for Boost.Test that outputs the logging to multiple formatters
*
* The log formatter is designed to output to one or multiple formatters at the same time. For
* example, one HRF formatter can output to the standard output, while XML formatter output to
* the file.
*
* Usage:
*
* // Call in init_unit_test_suite: (this will override the --log_format parameter)
* auto formatter = new boost::unit_test::output::multi_log_formatter; // same as already configured logger
*
* // Prepare and add additional logger(s)
* formatter.add(std::make_shared<boost::unit_test::output::xml_log_formatter>(),
* std::make_shared<std::ofstream>("out.xml"));
*
* boost::unit_test::unit_test_log.set_formatter(formatter);
*
* @note Calling `boost::unit_test::unit_test_log.set_stream(...)` will change the stream for
* the original logger.
*/
class multi_log_formatter : public unit_test_log_formatter
{
public:
/**
* @brief Create instance of the logger, based on the configured logger instance
*/
multi_log_formatter()
{
auto format =
#if BOOST_VERSION > 105900
runtime_config::get<output_format>(runtime_config::LOG_FORMAT);
#else
runtime_config::log_format();
#endif // BOOST_VERSION > 105900
switch (format) {
default:
#if BOOST_VERSION >= 105900
case OF_CLF:
#else
case CLF:
#endif // BOOST_VERSION >= 105900
m_loggers.push_back({std::make_shared<compiler_log_formatter>(), nullptr});
break;
#if BOOST_VERSION >= 105900
case OF_XML:
#else
case XML:
#endif // BOOST_VERSION >= 105900
m_loggers.push_back({std::make_shared<xml_log_formatter>(), nullptr});
break;
}
}
void
add(std::shared_ptr<unit_test_log_formatter> formatter, std::shared_ptr<std::ostream> os)
{
m_loggers.push_back({formatter, os});
}
// Formatter interface
void
log_start(std::ostream& os, counter_t test_cases_amount)
{
for (auto& l : m_loggers)
l.logger->log_start(l.os == nullptr ? os : *l.os, test_cases_amount);
}
void
log_finish(std::ostream& os)
{
for (auto& l : m_loggers)
l.logger->log_finish(l.os == nullptr ? os : *l.os);
}
void
log_build_info(std::ostream& os)
{
for (auto& l : m_loggers)
l.logger->log_build_info(l.os == nullptr ? os : *l.os);
}
void
test_unit_start(std::ostream& os, const test_unit& tu)
{
for (auto& l : m_loggers)
l.logger->test_unit_start(l.os == nullptr ? os : *l.os, tu);
}
void
test_unit_finish(std::ostream& os, const test_unit& tu, unsigned long elapsed)
{
for (auto& l : m_loggers)
l.logger->test_unit_finish(l.os == nullptr ? os : *l.os, tu, elapsed);
}
void
test_unit_skipped(std::ostream& os, const test_unit& tu)
{
for (auto& l : m_loggers)
l.logger->test_unit_skipped(l.os == nullptr ? os : *l.os, tu);
}
#if BOOST_VERSION >= 105900
void
log_exception_start(std::ostream& os, const log_checkpoint_data& lcd, const execution_exception& ex)
{
for (auto& l : m_loggers)
l.logger->log_exception_start(l.os == nullptr ? os : *l.os, lcd, ex);
}
void
log_exception_finish(std::ostream& os)
{
for (auto& l : m_loggers)
l.logger->log_exception_finish(l.os == nullptr ? os : *l.os);
}
#else
void
log_exception(std::ostream& os, const log_checkpoint_data& lcd, const execution_exception& ex)
{
for (auto& l : m_loggers)
l.logger->log_exception(l.os == nullptr ? os : *l.os, lcd, ex);
}
#endif // BOOST_VERSION >= 105900
void
log_entry_start(std::ostream& os, const log_entry_data& entry_data, log_entry_types let)
{
for (auto& l : m_loggers)
l.logger->log_entry_start(l.os == nullptr ? os : *l.os, entry_data, let);
}
void
log_entry_value(std::ostream& os, const_string value)
{
for (auto& l : m_loggers)
l.logger->log_entry_value(l.os == nullptr ? os : *l.os, value);
}
void
log_entry_finish(std::ostream& os)
{
for (auto& l : m_loggers)
l.logger->log_entry_finish(l.os == nullptr ? os : *l.os);
}
#if BOOST_VERSION >= 105900
void
entry_context_start(std::ostream& os, log_level level)
{
for (auto& l : m_loggers)
l.logger->entry_context_start(l.os == nullptr ? os : *l.os, level);
}
void
log_entry_context(std::ostream& os, const_string value)
{
for (auto& l : m_loggers)
l.logger->log_entry_context(l.os == nullptr ? os : *l.os, value);
}
void
entry_context_finish(std::ostream& os)
{
for (auto& l : m_loggers)
l.logger->entry_context_finish(l.os == nullptr ? os : *l.os);
}
#endif // BOOST_VERSION >= 105900
private:
struct LoggerInfo
{
std::shared_ptr<unit_test_log_formatter> logger;
std::shared_ptr<std::ostream> os;
};
std::vector<LoggerInfo> m_loggers;
};
} // namespace output
} // namespace unit_test
} // namespace boost
#endif // NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
+104 -11
View File
@@ -1,23 +1,116 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2014 University of California, Los Angeles
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2014-2017, 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,
* The University of Memphis.
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
* applications for NDN, originally developed as part of NFD (Named Data Networking
* Forwarding Daemon). See AUTHORS.md for complete list of NFD authors and contributors.
*
* ChronoSync 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 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.
*
* ChronoSync is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* 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
* ChronoSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
#define BOOST_TEST_MAIN 1
#define BOOST_TEST_DYN_LINK 1
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_ALTERNATIVE_INIT_API
#include <boost/version.hpp>
#if BOOST_VERSION >= 106200
// Boost.Test v3.3 (Boost 1.62) natively supports multi-logger output
#include "boost-test.hpp"
#else
#define BOOST_TEST_NO_MAIN
#include "boost-test.hpp"
#include "boost-multi-log-formatter.hpp"
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/variables_map.hpp>
#include <boost/program_options/parsers.hpp>
#include <fstream>
#include <iostream>
static bool
init_tests()
{
init_unit_test();
namespace po = boost::program_options;
namespace ut = boost::unit_test;
po::options_description extraOptions;
std::string logger;
std::string outputFile = "-";
extraOptions.add_options()
("log_format2", po::value<std::string>(&logger), "Type of second log formatter: HRF or XML")
("log_sink2", po::value<std::string>(&outputFile)->default_value(outputFile), "Second log sink, - for stdout")
;
po::variables_map vm;
try {
po::store(po::command_line_parser(ut::framework::master_test_suite().argc,
ut::framework::master_test_suite().argv)
.options(extraOptions)
.run(),
vm);
po::notify(vm);
}
catch (const std::exception& e) {
std::cerr << "ERROR: " << e.what() << "\n"
<< extraOptions << std::endl;
return false;
}
if (vm.count("log_format2") == 0) {
// second logger is not configured
return true;
}
std::shared_ptr<ut::unit_test_log_formatter> formatter;
if (logger == "XML") {
formatter = std::make_shared<ut::output::xml_log_formatter>();
}
else if (logger == "HRF") {
formatter = std::make_shared<ut::output::compiler_log_formatter>();
}
else {
std::cerr << "ERROR: only HRF or XML log formatter can be specified" << std::endl;
return false;
}
std::shared_ptr<std::ostream> output;
if (outputFile == "-") {
output = std::shared_ptr<std::ostream>(&std::cout, std::bind([]{}));
}
else {
output = std::make_shared<std::ofstream>(outputFile.c_str());
}
auto multiFormatter = new ut::output::multi_log_formatter;
multiFormatter->add(formatter, output);
ut::unit_test_log.set_formatter(multiFormatter);
return true;
}
int
main(int argc, char* argv[])
{
return ::boost::unit_test::unit_test_main(&init_tests, argc, argv);
}
#endif // BOOST_VERSION >= 106200
+11 -9
View File
@@ -8,8 +8,9 @@ def build(bld):
target='tests-main',
name='tests-main',
features='cxx',
source=bld.path.ant_glob(['main.cpp']),
source='main.cpp',
use='ChronoSync',
defines=['BOOST_TEST_MODULE=ChronoSync']
)
unit_test = bld.program(
@@ -21,11 +22,12 @@ def build(bld):
install_path=None,
)
integrated_test = bld.program(
target="../integrated-tests",
source=bld.path.ant_glob(['integrated-tests/**/*.cpp']),
features=['cxx', 'cxxprogram'],
use='ChronoSync tests-main',
includes=['.'],
install_path=None,
)
# TODO: Re-enable when there integration tests are implemented
# integrated_test = bld.program(
# target="../integrated-tests",
# source=bld.path.ant_glob(['integrated-tests/**/*.cpp']),
# features=['cxx', 'cxxprogram'],
# use='ChronoSync tests-main',
# includes=['.'],
# install_path=None,
# )
Vendored
+9 -8
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: ISO8859-1
# Thomas Nagy, 2005-2014
# Thomas Nagy, 2005-2016
#
"""
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -32,12 +32,13 @@ POSSIBILITY OF SUCH DAMAGE.
import os, sys, inspect
VERSION="1.8.2"
REVISION="a01aa13963437a19e5d8748cf2afd71b"
VERSION="1.9.7"
REVISION="c00f221443fc5d8f60edfcad309d0601"
GIT="4095f1403a11e4138d720e650b435411e757ed70"
INSTALL=''
C1='#/'
C2='#.'
C3='#)'
C1='#.'
C2='#)'
C3='#%'
cwd = os.getcwd()
join = os.path.join
@@ -164,5 +165,5 @@ if __name__ == '__main__':
Scripting.waf_entry_point(cwd, VERSION, wafdir)
#==>
#BZh91AY&SY�ÉLt"ïÿÿÿ¼@ÿÿÿÿÿÿÿÿÿÿÿ�†¢¦x€�#)!2„Xaé\÷x¬#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)/ºúÕ=[Ý{{žÒá¯Z»må˳]9y›o�3ÏZÝ»½õ÷SÒû5Km»¶÷מ£ß4àÖLÕ—sª_^/^Ü&.ëm˜}+Üe#):z{·¡íªì÷ºìUg­•:vÚi>{×�˜×ÍÞçÁï>jWlúûí÷Ɔ»·}Ýw½öpôYÛÆÞÚîÇ>ï¯m¼Øv,¶uÈ#)#)#.#)#)yì#)ƒÉl€#È(MÛÞœÀYÆ`Ë'F]Ûg¹î¡ ƒ\ê¶#.Bí©¡I#)×Cvf(’ªR]íÒOcAT””•QZÉI#.7 mƒËmªéíÜ<z÷޽[vÎìê¬d¶hÒMyU,j¦zS/ݽ{wß};}ÛºÜ{|ûŸ^ÖY}k¼íŽó7Zö³Nì»[Vónßb¾÷s­¯WÛ¶hä#)R¦Æ¨#/¢‚{$�Q‡•›™Ü»¯3Æ€#)¡{w³%¶d‰k{Û½Ûp $UPÞg»š][i­Ž™½º'¹ÚíÎÞðÉÞ·‡[½n÷ÝæÛ·ÎßYUH’:lVÖíÔš˜×mòÝom;gps³:ÉßõOkl®õãxß{Ü÷ÚµÞÞõXZcÊžÜצ¼�J@#/U&ûÞ<™5õöó½=P®“۽Îo³¾òv}{Öw\ç{ÛÞíu=鯽ï5>÷w³×¾ÖiÛ{º­gº»Þì}ëÜ oJíâ®yžíÅv;·‘ëÛ6÷¼jöª´¥¼u¶Îí¾ª•B’n7nï}Ís³ïžï]{çÝÙïI^ÞÎ>ÙãåÛ4¸·Ý£]´wvÙ]Ëžî6½ç]½wÓ0zOžó{ÌöoƒÛƒtÜÓ€P¡P ” Øwf²i»r޶#/¹u´œçFæù=öò<º—Uó½ç•ÛÒ¥8­¬Á¥—¶ÆJ�¾,¶Þ|sß4PSß\èT#)‡ÞÍîå}ÝÞw¾>ûÛ\àxï¾îñ{�D½Ø[®�ºÓ›ïmµowbn£#/6Ï^—»µÙÉ«�ɽ¾ïuWÑ_{®ó>öñ2}ëáô€Õëï®ïW¯Q×»Ð=öo©_}»°zµ»j[}híîç½÷}öíÝ.·ºÜ÷[Çw®u·´ßl6µçw9á{[NOrÙµäﶪÒ6önæPO¬Ó•,ë}x>&ƒ ÓCê¼5[Œ´ØÕ÷lóž{ÞÁð¢@iñ#.:ù¦�}s{¸>ÊvçNÞös›Ó›Å[Ÿqœ«ßmn÷w½ÙõõióÎ7½'ßX}÷»A·\¥Ë)¥ ¢ûío}bù÷T‰õ½€Å„)õ¡îÈè)¥³%Ú³Þó»°6Nîwž¬i¼û[ï¼à2BÍT+g!÷°ãå Ó‡·¬vîw4=.s›¥soº�YÝÖÝé½´(ªH½vâv‹·*�Ù÷›šìçÓݬ«¯s{¬®ûÙïww¯¾õÞ;_ëßN¥_z·fçÞÚ÷n©Nœ�;ÞÝäS½ŠÓªÕé^¾Þ2Ýv{ÞíÉ÷šûìKQm\¯#½zÝä݃êø´%4B#) #)#) É£@#)&�L&¦ž©£O(PÓMSÐÔšši�)�'¦�5£M©é=!§¨hz�¡ê#)#)#)#)#) ˆ‚#)"b2#jTü§µSÍÒ™êi”zFÔò�S ¨#)È€#)#)Iê”’ ªj~Tª=¥6§¦¡§©£Ò#)#)#)#)#)=@�#)#)#)‘#)� ¦šM#)M`M&OL�žQ²ž“iP#)#)#)&¢ €€#@&™4 éSõOh¦Ô�eêÕzž¦›Ò›P#)#)#)Ð#)#)û|Ûú¶ÛWtI?³’wV5sZÍßom©»%‰£á¶Ôå)) ŠZ$‹‚¢#){V@åöüòÎX?æì¿eB?8ý0LØã©‡š.$…5dÆ •ˆƒŒÅ3d�‚o�ç÷ŸAÿ´“ŸRù¤ :‚]X�A#)»/¾_ Ý„sE¾M̺Ôq·ª¥ŒŽÒ8æœÈó+¹IŽ0zË|-8Þ]Y‰ÔÁt>±q/eBœJµJ”ÄâqQa³[à’;Æöu8@!ÿÄð‹¿äÈx±!4…(ÒDa†*„¨¥"CJˆÌ�Jƒ@Ä"›*„ˆ® ‰ÞI#)iD(ÞE(#¢UH€û! °¤ª8šÂ•¤#/AÔ  )æUÛ%€P`ÌJC3LH„È…Í£fh‰)©±‘2RŒÅ-¤¨je,P4$&�©Q´”DJ™¢l¡l–JÌ ‹ L)A±¤Œ›hÅI)iª$%–’5$‚`Ê"F¶“T,šliblŒPRJ)¤HÄÓ6-�SU¦ª¥$ÖXŒ“$j6‚𥫙³4¦©,™fª%M±1³T’T†™’I5Ì�HÍhÔ„lšf‚‰(Ñd´�Z)J¤†lb`…‚‰šLM6(`›)°L ‘ f*d™ˆ“ %²@‘KŠÉdI�„)%%6)2AQ)Iµ j 1¨lІ,L(¢”��%iDÆ,LTl™M¢’e¤‘4²4‘’T¢Šf¤*iM†$Â@¦ÄjK#.›D�l‚‘&**"#/É�¦l`’MIE$dBDÌˆÍ I™31’³)�¡,b$"HJ“a I4ÒÐbLš,¥0lÚ#M"�¢¤€J3A¤I›RÍ,¥”†“K$Ù¦Q 5,RY‘±£+$ÌI"ŠÀ3c,�¨’È*#/Yš1´YCd£2›4IKZl„Êc $jL”™…2RÍF’Ê•L ¢“QdA%() FHi‘¤H4– 5¤Z¬„34‹&aJB›I²E²E£I2I(J,”4�`"���“,E#.‘6k1“RXÐJl2™¥1 #.…¦MRÆ,ÔØ¤Ê,ÒbJÙ$…”T‘bSL h� Å&M)&a²lš2d*#)„k$ÊÄÃh,›%!K&Q�Ši ÉL¤eˆÁi)TÙ¬mˆL‚dJHŠÑ�±¤™¬ŠLhÂHaQ¤2@KÑ´jR1EbKI‘™¢“ ,ˆ”!ŠY#)Z4™ eFi#.›U-m ¤ª(É© k%ÊHÚ)’™&1¬–‹4HÓLÓM’”¢ÔÈÆÍ±(Щ²ÊFh¡K_‚­Ñ²V�ÈK(ÉMbÖŠÅ¢£BfTDÓl–ƒTÆ¥ªb(lXŒ4¤IÌld1¢¡–¡5E‘MdÈle•E¡bdÌjZYŒ�¨°ÌÊj³F™ Y©¥°Ö4ÙD–Te*±MZM¤+6V³RRÃm1B™b´i©Q%¦QDe�¢±¶f�²Ufj�V*J6ØÚ6 %CDB¨¤*#.±ª5 Ô†Ö!5’E´Ñ ¥QH&ˆÃ5(”Ú•F£d“hƤ,jšLÚµ›Vš±ašÆË"eMdI–šaI3j¥¨¦ÌÔÒ¦kJ¥d­J˜ÛJ™JM©¦ÔÙlR#.lÖfd’²ÅÁ©-¥´²ZšFÄ@`i±¤£H„Q°�D1mÉ0)µRD¢Å2šÆÒ“MŠŒ’h4”Â…ŠeDX¤–cBi¢™)“ÊlÐÆ‰ CbÅ™!ŒR³RX m™dË,Ì!#/RÉ�ƒ ±QFÆÄ””dh4‹2‹S1³¤¬i„̓FM‹ lËP)¢„±DE")´d,Í¢Å��Š4"¢4––H¦`´)e ÂH“�šJFS`ÉlB’Ò$“f¥š¨Ò©™‹#.Š”Òl�¤Ê,ÑV(�Ì(’‰I$ÙI4•%£)3H†•5–lme6V*16)4Ô“,É¢¦[R2e-%%²$”K1 Ó(ÑD#.e“d¥ LDÔ�‘h¬FØM‹EFŠ6ÄVšL2LÑ%&‘h¦#)6)"±`Û-4’T†£Y3#.%,Èl…hѰ†Ñ¨­“F„Ë#/ÐDEd¶* c ()5JQ5cXÊfhB¢¤“i…ID–��ÑY¶©‹2j,Q‰+%¡¥4±¥%4IRÉ*JR”£VÄ¥"‹%+e%�²i*,m¶f)”l¦²¨i&l‘I±a�B"Å‹LÉC4`ÚL‰L±"Õ(�0™Kf"”j6¢ØªHB¡’c@FÊj�£i’X©#)ÐbŠL"MZPQiMR›IQ[ÆÖf+%¬È#/Ñlš’‹Å(#4cf„I �’˜4`ͱ�‹hØ¥6ÚJh‚±€É¨¨�­6Ë-FÑX±kI¶¥³d4²±*ŒZ)–*¦¤Ò²Œ£E(–LYR¢ÒVM¤Û%dÕŠM¥3(²m�EIF‹F¶Û5­4f¡²X‰*eEF° Z#.&¥³VLS*ÑDUŠÑ¶Å¢ÛhÚ¡–Mkjš••DÙH6’cÊÂÊQd�šTEÌlII”“"!jMb̵L|>ó~i¯éyÛÇð‘{ßÍ\«E½fý;i6N£#ý¿òþÞS´W d]j¢$LLY¢ÒE˜pÿ«ýT|#.¥)°T\AÈŸúgQ”lÿ©ö�+Û=i÷é8ÈnT-ƒ²Q¥U¥uI ¦é Dn�™#/·ÿ5_Ͼ!kÒîƒÿFÃû>û®ÃüëI2h•ÌäDL³¶»Yb"<ŽÂ #.¶nà]uø^Ì?v§;q0ž¶ã?¨…NéÇX;£QLC§6íˆéTf¥5F�ª2Ù$”¤©�·_Bðjck´ðb­¡Ø£Â¢5Š UwCkJÉTe0ÀÙ¤ŽJ’5äØ2¨…*(Ä´ÊÍh¥P5W³Ñü½Jô·³ÍÍFÉk1Q$âQb-ÀFiw.Š‹u@(þó«ÝçlËÙ¹I��¼ëÅ4â�" ÿïCýª0+1‡j¢AÄŸ6.ZÑ1íÃxÑ#.-WÇýº4=þÂv#/…•µÚ*�6P…²P€§†t+üs’ãLãPºˆÑˆí}[ï ÿi<;ð:N¤¥!V&CS‰MõlJ=i¦Žäâ+kqeœÿ7ñgH \Zšp»PD(aB1¼Üó®ît]ÆŠæå&�¤ÊDUCBWœŽÂyChJ;sÑ§Ó ¡�ì•(*H#(k‡=?#/\‡nÔØ28¸o}up#§²®ó@’�ñkñÛ^éé{𮥷³PhmØ£Ö21ðùÞÞ–H‚ê4|:EZ9`ˆÜZ©R² ä 7n\“w]‡uÓEA½ê·žw÷/š«H(¡ä•š%€‰³[5¸�ND”Å~uKꢱü+LySÿ5é‚eƒÿB©6J®YÆ*%¡x¨È I+ù1�ϳ iuÔÎ%É…V’QøUkÛrú#/ç÷EÏèñé™ìâ£Ær2?f_ C<ᎲB8ãzçÿRƒ¹5NÆ¡ßÆ—dÏ>5~Ä�±qC¡.çíí}ËP˜Îo¢÷Ìå!³P‘ö`rÆw¸C:¥ ÓÖèÛAÙÙW0´d;Ò×¢ÆÑX»0¬MÖ/R„PX%ç¥ãèü1F‰*'Mh³f ØÒƒÆçµ—S+áîß¿ZÄ›#.KHíÿ—!¾ŽëØc$4Ù&27åúí221ÀÍì¢aÍ×e/)Qì´½ÅFv“¤8ÆäÈÈY[i¯ÙÒ”cB'ë!î.êm+Ç3,›Ås]He �¡»¬ªJ]§<0=–¨™ÿ³�wîÄê71)¬‡$LÀÅ¢šÑ`Æ# Rzrå}�_?·ª¶±¡[B�yÖ ’'ˆ… -%$"˜K<P4€«µËcIÌŽ2�ø3\σ�%²aj#/Î,³$©±6„ؘÀî5Œ#CÅ TX]Q4£¶ôõ挃þ‘¢è)€,šùPöÍ�åDå’¡„DJÚÍ›éjõ(�µïï´ò76êo„º‘‚…4£†ÜîÅ“q�¤Þ¨.´BÒ$¸àPj‹{)˜²#¿¦kJlÍFd@îª-¥Q4í»¿‡—,�ªJgoeYRLHÀ]ë²áͺ$cb}¤e|¦x<C%¨÷b#.²µ¶–œe‘L„5|HÙæá¶ºk#/ÓÙÖDVxvT<Y€Qâ�µôáF$Nú¦ûª_…Qš‘Ñ}ÎS3–»{��ÚG½W'²¬äé•Z …WµÍòÂ?ÁV‹S:Ð¸í»™áW'h#.lÌ‚MˆZ�ÆÕåPý¤óÚ˜†‘�¦Ã¬!açž7?Òú_}ÓGúzô¾m.¨l8ã]Y„?ÇÒ¹3L‚4‚ÃÉ XŸm½§"úr‡±5¸uì‘FÀ*”Ð!¡ÈiZ¬mØ�\¤<ad¶A�ëÙÙY.ÞðÁx#/åÄÈq0”ÝM6á¯GÊ�ŸCay¯õ'h L~²XG=ñö«>^3ßa·ÊÌT;ï’Lq»óÆV1^75&}U4B?->Ó36T ¿sž ª#!slÏdª¤?¦Bü†”<ªô©‡«(uÉ=Rò‡x6Ÿ£WÍüIFY¨è_Ún‘õÐh¸ùyϳwkŽÇ'~jKOWáÇY/(yå…ÂHÎl4cLine truncated
#BZh91AY&SY¹÷{4Æÿÿÿ°@Êÿÿÿÿÿÿÿÿÿÿÿ$ˆ#)á ð#%E„(aþ\÷>ûw‘#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%#%«ßGtC-±ªëT®¥#)}°�w'm•fݺ{tê©ybZØ·§vǵÛíä÷º:wo§Š,÷˾¦³Þݳݞ╩:$»Íî÷[Ûµ´ô ö=#)ìEoS‰t#)¾‡Þ6³Y—7Þø}뺣=¼O¹�$û7Þ÷ß}ß|:½íñínÍ·¶÷Ø0;ÌÖ.­iÕ€#%#%;Ø#%l#%é@ÀŸOACÀ Ù—0èÛܬ 6‡ª5ÝMS ÓA ‡s;ì¯hôÍ#%�Ð�kÙ…+¶h%`#%ª„¥D¡w¸ôkYI(#%¤€=`$P¢ïpöðr ûÌ÷¾îãoqÛo[7®N÷º÷]sJlè8¨í½µ�ZßO¥í§¶í  ­÷>ñÕæib�vñïyèÛÜ;n^¹½ÍÝÞ½W{|�ÙÜ÷�òiæz›>ªšðãw·¥í{±Õ#.éov�#%Uz×­°¬�kZéíîöÚîïsvçtÂ{b…eï=7nI’D$öõÚ`#%#%H*­€i¡ÏBìAÉJ[˨;šÛ&ö5*>Þò¼ûÚï>¼ÞûÞk .Æ�¯O EÖÖ½usîC å¾°vØØ#)öîñÀtéíîÐ çw"q÷;ìzrî÷±é÷Ǧ½ÙÁëötS}qޝ»ÎÛx¨;™”¼/8ùÙ{éÛ9ß]ïim×m¸Ë«»wÛ{Z�´ÞÜmÎèîk¶W¸÷¤ô9¾ßW+šÕA=ÃW^÷¼ôè¡¶â>žÙ[–Sʾîí¾9vkÃÁI²UáÝÝ�Ÿfú÷$yµõÝ®³HäsöO{/¾îú'ܶZ÷gÎKš{°•ÚîÏ=˜#%ö®yæôé÷}÷ƒJÀu(¥#%¨”„#ì=Ì-¼»´ “¶j±½àέCNƒÜg'w»¹é¯†îÕE;“‹×�{)×»w„Ö{39Žð#%îãª#%#.7¸½÷¾ùŸ*úóÝÞìõí­©½_yÈvÇlïvûÞ{º#)Ê#k³º‚w½ËÛåè:$}ŸFݺ®!͇}ÝoÙž¼çÛÞo%ðVîXvÕ³JàõÞ—´¢¯2ð4ódd3í¹æùÇsƒNÎé6o:˜Ï¸|v[Ý—u}uצÉݬ½»Þû¼ù[VÛ#.Ø6¬Э>†Ýœeºõ°vçh7L&.ÑâÇyµ»²Åw®«.êwbðMž©Å]cr�mï{Þ÷»ØõÝÑÓbÇŽõîÞûÛÕ½ôw§«î»uï3m×®VŸ: îúÝ1éÖß:T#%äСÛs�.æo^thÆ—ƒ‡lŽ^ëeÜ Ø ³è h>ŽSÚ¶ #%£käïµ>úo·8B¨]{{oi»9¨w±syâìÝݹ#.ûwÛÅUÉÚss£vàgjUIås»jDS¥Äm³Þ{žifß.¤—gp£s¯w¾|xì>}Ùw'E)à„^Ì2[g±ÄNê°hÛn^ŠT·Ý¾õXÖ¼»ïs·Ûšwwk´x«z‹‹”ñ¯ŽàÓD#%�#%&€b2 ¦L&F)„“òOTÐÊ4y@Ú ÐÐz�=OÑPJh‚ &dÓ"4ÓM ”ñM¦ cD1‡ê€#%#%#%#%#%$"DÑ�ÐSaFL%GíSôQ<SôD4Põ¡&@#%#%#%#%z¥Hš)í4i¨Ôõ6 6¦�Põ#%44Ð#)¤=M©µ#%#%#%#%#%#%$ˆ #%€#%ÀAOh›Fˆ˜4Sj4#)#%P#%#%#%j"a2#%M&©úi”ÆJ?ÐŒ¦“õOQ¶‘¨dÈh#%#)#%#%#%ý}—ùõVœH©j5lFtýZ­waM�ŸUV»„Y�£Hƒ"±!1j*‰Þ1OqïöþJ4ãÌ~qDIRMQù_æbeÞ)eØøNb-é®Õ¼Æ1Xµ‰X¬ŸÐ#äÄa{€xì0Ào#%›2�¢@››ðR¥+#.`5S¸ÛM¡;#%–®ö!øj�œ»˜ríÞ÷E©ˆ–²RœM^½Í]¼Q‹¢RÅ ŠÆ±ÇùhÌ'Û²¾F¶ÄR R1"²—uuVšµcm´›ZØÕ&¶�­FÖÕíV•U¹bÁƸØ DQ3)#†0Qoè„#%nD„\VˆaH#.¢DdELE5ª É�Â&364ÌÒÈ�’ˆÍ&�™¨‰’¡ÆDYJ4¢›i6©™&‚Q“TÔU #4–#.i¢lÆÆ2&¥( �F¥�#%i‹*mH¤Ù-¢))e¥)µ e¤ (& £61­’¨%¢)M2 ©(h¦•"(FSchØMi­´ªÔ…2Ô3bM‰’DA–JÓkFih¤¤ÔÉS[ÙªdÔµ2ÒY12JŠ64�•²J()‘F‰*$M¢”Ö) ѰÁ ŠCLÆiQT¦Œ4DŒÊ0KC"2I°Ù+HHE,DŠÌ¡�1!"JiY£&&�†"–-IQbƒP¤T1d‚,jR˜I‘‰DšÐÆLLT”iѤ„ÚAI4˜’,Y”ÔÆ)�6+%†lBE,3*I†LB›É E•†�’IŠ�ŠQ%„щF‚JE,PHL% d”�‹,™„Y5™Q´&ÉRL„Ô› HD‘d¬€ƒY˜6m$bh˜#`™bHŠQ› BLÛ,ÆARÁc $i–(ˆÔؤ²FŤ&SI2ÉF€D©f@±&„1*Ie&PcQ¤Í"¢†Fi¢&ª Be‘¤²1%&DÐM2‘•3#.5”ŠLTC)“¤Ê#.F4BC2P˜ #)’eLÍiŒm”Úd‰™š‘H… Íe-0ѲE€¡$‰(‰,Y6l�¦hÖ!�RfHÉK"lÚ`Û‚"™’†ÌšS$) f,ÊhŠ”IEš–R“4RFLI‘JɢɦÊA@Š,V RI‰$Êj6M�"F�Æ„“Y¤Ãh4lf “!,™FH±¦d1$Í’™¢!-!5M›ŠÐ™¤¤‰ Q¶ A2Ù‰2ØÂA„e$TX%D£iI�F±šd)(¦RÆÈ‰L1K,i–Q¤J2Œ¤4MZ›Zѱ$˜M2ŠS#E“2 Öƒd¶%,Ѧ)22™¥•,ÐZ™£alŠXˆRÆR04…4µúí®Œ†ÊÒ¥–Äj6±´Tb£dÉ–TCdš44´FÂ6I¨ÚÈŒ-2b1J`%IÈŠbfišÉ«’SY) F#.P‰bTiBÁdÉKJdÉ›& Ø²­4i²„VÊ‘TªVaM›Œ¥­‹"5²i•‘*K3k%Yl¥)¦Y)‘£6–$´”Êm�¶#)l%�j$¨(ÛhLjJ6¨Ú,l›hš2B¨ ¨,U‹bÃ6�l&Ù0±l…(%‚h£jQ4Ú•ˆÛ‘+´…’ÚI-µ³m´ÈlT$&S*jɦlŒHKH¢’6Õ-¥QŠe¦–Si¬Ò–©¦#R¡eM´³T²*!m -™2Hk,hf™dÖ–¥�µšb ‚!•HÈc0&Œ C!¨4&02ÔZ„ RTa”ª+$ÓFÉ“IF�ŠE,ÑT‚²ÈȆ2‰"P¤£e3@ÅA"Jh4Z*d„E-5&)bÌÓB&’¨ÉŒ4ÂFKE‚²l&Å$±‰3AK2BÔÊÌE&4ÂeI¤„¨Ø¤!(̪ ¦,Í$”fd) Y›DE3hØÆ¢Å ²lÐ…-4…FC"4hÓ)¢JJYKBd¬a”Y$± h¦‹TlÖŒÐj*YdÙ�¤Í¥“hª4  ’ÆAd’ÂT•¤T¦˜²AF[$¦Æ Û0©¤ÒXÍ%iFa¥6™µf34ÓS4‘ Œ¨" •4ÁÆ�³BŬÒl”Ä11II FѪQ¨Ôh£lEFe°Òa¤’… $‹E(‚6(°&ÐVYdÙ) Ø´d,”³If´l$[¨“E –ZƒE©5FÁF…†1T¥#)´Z#))fY#.�ES#PDZ4E”ÛY(¬V2`,š"™”-Ld)ID•,J"JµÚ#.,”Y*5S3E²RV6µ)ŠJ6Sl†²X´4K6d•#)‹LRQ’#²a#)FI�A­™0b›%)³6&"•EQ™Y5’)4“QAŠ2š¤¶-”“E’ÑE�RejPQiM©KQ&£Uc)‹I­‘#%Ú�cRQb‘JfÈ̉�*DPlÍ™­b©4[F¤´Óm¡•ˆ1TjB��Œ†´S5šm¢Ñ¨±«-©22”HYYX›QŠÅ™cj-*XSl£,jbRA²�£b‚J�%±¶,ÍI�RZÅ&ÙLÍQ£hÃH¨¤¢�¶Û6ÛM,‰–0”I°Ä"“F‹*Iµ!‰%X­Ø´Í[F5¬ÚMše­ˆ²[SSl…µm¢Q”P26’cÃYS5²È¨ CQ&$“)&DÈ[&´Yš©�é?‡ÞÿAü.Œ¯ó[ùèÿ1o�jjÿ©*«èCT®9K�Ë2”ÏÜ L"…Ê4ï·4–^Þù¯áz¯\ßÑþ�^¤Â …RÓøë‹.)þÏ�D4a×%qÿnqˆŒ (1:7"T°\0RHUD&bo÷êh—Íø³þ­AŸýÿm�ôJ±Ñ7;)a#ù¹æÅ«Ç˜±‰°õ] èàž« ÈüìÂC±6Ýak‰F.Xz<(Óð‘½À$j1¨ÉÄD……M5ã¼n‰÷ÕÃ˺hë²w�ÐCFfÒ²Ó— 0ÊHÑPˆ©^#)»¶¸7­ÇÏk˜«å_/E÷>ïžß#)¸\ܨ±­šF·ÓÏw½nIkÏž×yÛyݰËèÜÙ½niU"ˆÅ•u G#)F¶¹qÊÿÉeŸçBRE-†÷L`UlÁe-Õ§�KK( ,_WüxC±æÛ1<›ÂÚŠNÞ+ï9’)�+½Y%°v ;Aþ;Þ`´5äÎGÙí…h цa»}IîàÚž'†,ÂåGåçÆÿ4ZGg{¨i¥Ø( Xç#)–¢…4Ð]Æ�ÍÌ”…[$$X#.w Ä`Z#%¼ªˆ¤õUÏjO0¬Ý¤€SJ" %%4ѯ {,¼QË•ÄÒjºpÅà)5Lº%µQޱF,h4Ê뱪4�Š4dƒ{œlË ÔÁŸ71V±n-TR°›‘;¨é\¹&2N»¥æB¢¨ÿ²If‰€)%",,Bš´Z5jÅ‚¿EˆyÔ×ô8Ó4ÿÑz`ÿqY4ã@‰_좙ºNzàµX*8ˆÆ#) ûqN-ºÅ?Ð$Á¯Yùbº€�Ñš8šç‘ÂhiVR|ªºos°ÁÃê©ÑýÞªÛ‹Ù_‚ÂËŒöÙdzc‘GmħWŠrtdØI[øÞã¥m¥CXÌu @ØB�#)P”è³�²5­á‡1ÉeE–äT *#.8@¦ÈXFDè™LhÑ™¡ý–pÔ<º@Ë1&Âl£ë¢×¦Úç…iuL%4¬´;¬¥b�éÒñò}ø©ØºÖŒMùó”ÂH#)vZ‡Cf8¯¹—o[Ù®-´.ª+Z7þâ×FX²,S«@¬DbÄD¤c“ÛAc :Y]v1Ñ£´4UÿÞq¿iðs¤ ¹ÄíX¬cå½X‰1\t£›+±)qM �±F5ãsI±¼XÛÇü_*ÀŃàÔF(W�­±Œâ{¿uLö�­ÊÊü_ôÞUëE�,D¦¢“éÝs_>umtéËrîºÄÑ9Ýe)"á)X«)%0бyß“{ïyÑ”£cY6|ÝË¿^k¯—còvìV0‡ÛÜú»nßôóÈy‹‹&¾Çáo¨,„ô5ÕAhí½Fxùæýºð³#%ÉþƦ*’š`pÖ€çÃ6?uC¦J "1Ò¶³d<�˜AI­snzЗ¬E„FC­P»Ý I+§ /#)F IZÔ-†Ì˜YKJZHR ÛPZÒœËÄôÑà›ä¢™J’ê­¥]»êÅ##)yä2ïáVîòBÎþë°bÂ*0<®ÔÙ†¨Ze¤‚0§Xôq«°·ÊˆÃÅ¢4¶ÒÓŒ±Ìe.ª�¶ÏHCû‹8p¹lU©Ï¶¤óCâ�­Ê=× â£ÙÁÅÕÇöÆðxŇ½Ž«)¶åßðÍX¸„ïñ‡Ñ�ìo‡ªwb«¬‡éÃ%pî©dêÀÕ–Ã<l°"€"ƒ‹ÑT‚{#.òÒV Ê()#)h¨pkþ4Þü/,=½ÔD4o…taýþºàÍM�¡”ˆø´#.riGëÞ�ÏË�únŽÜœ¼û=Øm#)$m l'$çq4ÛÏt¤—"X܈ÝÕDuûYl4RDÆÍê RøÃw|f4¸¿M̉¦#.<Ü4ÿN·OY$á'�y?F.Ï"A**( ‘y{Î&† P£™Line truncated
#<==
+13 -6
View File
@@ -3,13 +3,13 @@
from waflib import Logs, Utils, Context
import os
VERSION = '0.2'
VERSION = '0.3.0'
APPNAME = 'ChronoSync'
def options(opt):
opt.load(['compiler_c', 'compiler_cxx', 'gnu_dirs'])
opt.load(['boost', 'doxygen', 'sphinx_build', 'default-compiler-flags',
'pch'],
opt.load(['default-compiler-flags', 'boost', 'doxygen', 'sphinx_build',
'sanitizers', 'coverage', 'pch'],
tooldir=['.waf-tools'])
syncopt = opt.add_option_group ("ChronoSync Options")
@@ -22,8 +22,9 @@ def options(opt):
help='''build unit tests''')
def configure(conf):
conf.load(['compiler_c', 'compiler_cxx', 'gnu_dirs', 'boost', 'pch',
'doxygen', 'sphinx_build', 'default-compiler-flags'])
conf.load(['compiler_c', 'compiler_cxx', 'gnu_dirs',
'default-compiler-flags', 'boost', 'pch', 'sanitizers', 'coverage',
'doxygen', 'sphinx_build'])
conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
uselib_store='NDN_CXX', mandatory=True)
@@ -40,12 +41,18 @@ def configure(conf):
conf.check_cfg(package='liblog4cxx', args=['--cflags', '--libs'], uselib_store='LOG4CXX',
mandatory=True)
# If there happens to be a static library, waf will put the corresponding -L flags
# before dynamic library flags. This can result in compilation failure when the
# system has a different version of the ChronoSync library installed.
conf.env['STLIBPATH'] = ['.'] + conf.env['STLIBPATH']
conf.write_config_header('config.hpp')
def build(bld):
libsync = bld(
target="ChronoSync",
# vnum = "1.0.0",
vnum = VERSION,
cnum = VERSION,
features=['cxx', 'cxxshlib'],
source = bld.path.ant_glob(['src/**/*.cpp', 'src/**/*.proto']),
use = 'BOOST NDN_CXX LOG4CXX',