-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I98c36a7763387cd27df88713e68035dff222b187
- Loading branch information
Showing
10 changed files
with
234 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,19 +7,48 @@ source "$JDIR"/util.sh | |
set -x | ||
|
||
if has OSX $NODE_LABELS; then | ||
FORMULAE=(boost pkg-config libxml2) | ||
if [[ -n $USE_OPENSSL_1_1 ]]; then | ||
FORMULAE+=([email protected]) | ||
else | ||
FORMULAE+=(openssl) | ||
fi | ||
|
||
brew update | ||
brew upgrade | ||
brew install boost pkg-config cryptopp openssl | ||
brew install libxml2 | ||
brew link --force libxml2 | ||
if [[ -n $TRAVIS ]]; then | ||
# Travis images come with a large number of brew packages | ||
# pre-installed, don't waste time upgrading all of them | ||
for FORMULA in "${FORMULAE[@]}"; do | ||
brew outdated $FORMULA || brew upgrade $FORMULA | ||
done | ||
else | ||
brew upgrade | ||
fi | ||
brew install "${FORMULAE[@]}" | ||
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 | ||
sudo apt-get install -qq -y python-setuptools python-dev python-pygraphviz python-kiwi | ||
# sudo apt-get install -qq -y python-pygoocanvas python-gnome2 | ||
# sudo apt-get install -qq -y python-rsvg ipython | ||
sudo apt-get -qy install build-essential pkg-config libboost-all-dev \ | ||
libsqlite3-dev libssl-dev | ||
|
||
if [[ $JOB_NAME == *"code-coverage" ]]; then | ||
sudo apt-get -qy install gcovr lcov libgd-perl | ||
fi | ||
fi | ||
|
||
if has Ubuntu-16.04 $NODE_LABELS; then | ||
sudo apt-get -qy install python-setuptools python-dev python-pygraphviz castxml \ | ||
python-kiwi python-gnome2 ipython libcairo2-dev python3-gi \ | ||
libgirepository1.0-dev python-gi python-gi-cairo \ | ||
gir1.2-gtk-3.0 gir1.2-goocanvas-2.0 python-pip | ||
sudo pip install pygraphviz pycairo PyGObject pygccxml | ||
elif has Ubuntu $NODE_LABELS; then | ||
sudo apt-get -qy install build-essential libsqlite3-dev libboost-all-dev libssl-dev \ | ||
git python3-setuptools castxml \ | ||
gir1.2-goocanvas-2.0 gir1.2-gtk-3.0 libgirepository1.0-dev \ | ||
python3-dev python3-gi python3-gi-cairo \ | ||
python3-pip python3-pygraphviz python3-pygccxml | ||
sudo pip3 install kiwi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
#!/usr/bin/env bash | ||
set -x | ||
set -e | ||
|
||
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
source "$JDIR"/util.sh | ||
|
||
set -x | ||
|
||
pushd ns-3 >/dev/null | ||
|
||
git submodule update --init | ||
|
@@ -13,15 +14,18 @@ git submodule update --init | |
sudo rm -Rf build/ .waf-1* .waf3-1* | ||
find . -name '*.pyc' | sudo xargs rm -f | ||
|
||
# Configure/build in debug mode | ||
if has OSX $NODE_LABELS; then | ||
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig" | ||
if [[ -n $USE_OPENSSL_1_1 ]]; then | ||
OPENSSL="--with-openssl=/usr/local/opt/[email protected]" | ||
fi | ||
fi | ||
./waf -j${WAF_JOBS:-1} configure -d debug --enable-examples --enable-tests $EXTRA_FLAGS | ||
|
||
./waf -j${WAF_JOBS:-1} configure -d debug --enable-examples --enable-tests $OPENSSL | ||
./waf -j${WAF_JOBS:-1} build | ||
|
||
# Install | ||
sudo ./waf -j${WAF_JOBS:-1} install | ||
sudo_preserve_env PATH -- ./waf -j${WAF_JOBS:-1} install | ||
|
||
if has Linux $NODE_LABELS; then | ||
sudo ldconfig | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -x | ||
set -e | ||
|
||
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
source "$JDIR"/util.sh | ||
|
||
set -e | ||
set -x | ||
|
||
pushd ns-3 >/dev/null | ||
|
||
BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; v = _cache.BOOST_VERSION.split('_'); print int(v[0]) * 100000 + int(v[1]) * 100;") | ||
|
||
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 | ||
export BOOST_TEST_BUILD_INFO=1 | ||
export BOOST_TEST_COLOR_OUTPUT=1 | ||
export BOOST_TEST_DETECT_MEMORY_LEAK=0 | ||
export BOOST_TEST_LOGGER=HRF,test_suite,stdout:XML,all,build/xunit-log.xml | ||
|
||
# Run unit tests | ||
./waf --run "ndnSIM-unit-tests $(ut_log_args)" | ||
./waf --run "ndnSIM-unit-tests" | ||
|
||
popd >/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
CONTINUOUS INTEGRATION SCRIPTS | ||
============================== | ||
|
||
Environment Variables Used in Build Scripts | ||
------------------------------------------- | ||
|
||
- `NODE_LABELS`: the variable defines a list of OS properties. The set values are used by the | ||
build scripts to select proper behavior for different OS. | ||
|
||
The list should include at least `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`. | ||
|
||
Possible values for Linux: | ||
|
||
* `[OS_TYPE]`: `Linux` | ||
* `[DISTRO_TYPE]`: `Ubuntu` | ||
* `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04` | ||
|
||
Possible values for macOS: | ||
|
||
* `[OS_TYPE]`: `OSX` | ||
* `[DISTRO_TYPE]`: `OSX` (can be absent) | ||
* `[DISTRO_VERSION]`: `OSX-10.12`, `OSX-10.13`, `OSX-10.14` | ||
|
||
- `JOB_NAME`: optional variable to define type of the job. Depending on the defined job type, | ||
the build scripts can perform different tasks. | ||
|
||
Possible values: | ||
|
||
* empty: default build process | ||
* `code-coverage` (Ubuntu Linux is assumed): debug build with tests and code coverage analysis | ||
* `limited-build`: only a single debug build with tests | ||
|
||
- `WAF_JOBS`: number of parallel build jobs used by waf, defaults to 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,89 @@ | ||
sudo: required | ||
language: generic | ||
version: ~> 1.0 | ||
language: cpp | ||
os: linux | ||
dist: bionic | ||
arch: amd64 | ||
|
||
env: | ||
global: | ||
- WAF_JOBS=2 | ||
matrix: | ||
- COMPILER=g++-7 | ||
- COMPILER=g++-9 | ||
- COMPILER=clang++-6.0 | ||
- COMPILER=clang++-9 | ||
|
||
jobs: | ||
include: | ||
- os: linux | ||
dist: xenial | ||
env: | ||
- CXX=g++ | ||
- NODE_LABELS="Linux Ubuntu Ubuntu-16.04" | ||
# Linux | ||
- env: COMPILER=g++-8 | ||
- env: COMPILER=clang++-5.0 | ||
- env: COMPILER=clang++-7 | ||
- env: COMPILER=clang++-8 | ||
- env: COMPILER=clang++-10 | ||
- env: COMPILER=clang++-11 | ||
|
||
# macOS | ||
- os: osx | ||
osx_image: xcode10.1 | ||
env: | ||
- CXX=clang++ | ||
- xcode10.1 | ||
- NODE_LABELS="OSX OSX_VERSION=10.13" | ||
notifications: | ||
email: | ||
on_success: always | ||
on_failure: always | ||
osx_image: xcode11.4 | ||
env: # default compiler | ||
|
||
allow_failures: | ||
- env: COMPILER=clang++-11 | ||
|
||
fast_finish: true | ||
|
||
before_install: | ||
- | | ||
: Adding apt repositories | ||
case ${COMPILER} in | ||
g++-9) | ||
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/+packages | ||
travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | ||
travis_retry sudo apt-get -qq update | ||
;; | ||
clang++-1?) | ||
# https://apt.llvm.org/ | ||
LLVM_REPO=${COMPILER/clang++/llvm-toolchain-${TRAVIS_DIST}} | ||
travis_retry wget -nv -O - "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add - | ||
travis_retry sudo add-apt-repository -y "deb http://apt.llvm.org/${TRAVIS_DIST}/ ${LLVM_REPO%-11} main" | ||
travis_retry sudo apt-get -qq update | ||
;; | ||
esac | ||
install: | ||
- | | ||
: Installing C++ compiler | ||
if [[ -n ${COMPILER} ]]; then | ||
travis_retry sudo apt-get -qy install ${COMPILER/clang++/clang} | ||
fi | ||
before_script: | ||
- | | ||
: Setting environment variables | ||
if [[ -n ${COMPILER} ]]; then | ||
export CXX=${COMPILER} | ||
fi | ||
case ${TRAVIS_OS_NAME} in | ||
linux) export NODE_LABELS="Linux Ubuntu Ubuntu-18.04" ;; | ||
osx) export NODE_LABELS="OSX OSX-$(sw_vers -productVersion | cut -d . -f -2)" ;; | ||
esac | ||
export JOB_NAME=limited-build | ||
export WAF_JOBS=2 | ||
- | | ||
: Enabling workarounds | ||
case "${TRAVIS_CPU_ARCH},${COMPILER}" in | ||
arm64,g++*) | ||
# Avoid exceeding the per-job time limit | ||
export DISABLE_HEADERS_CHECK=yes | ||
;; | ||
ppc64le,g++-7) | ||
# AddressSanitizer does not seem to be working | ||
export DISABLE_ASAN=yes | ||
;; | ||
*,clang++-8) | ||
# https://bugs.llvm.org/show_bug.cgi?id=40808 | ||
export DISABLE_ASAN=yes | ||
;; | ||
esac | ||
- ${CXX:-c++} --version | ||
|
||
script: | ||
- ./.jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.