Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis: switch to xenial build environment and add clang and C++11 jobs #195

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bb3ed7f
.travis.yml: switch to containerized build and enable compiler matrix
meyerj Jan 5, 2017
d414bbb
.travis.yml: add matrix dimension for C++ standards
meyerj Jan 5, 2017
a325555
travis: added jobs for clang-3.8 and gcc-5
meyerj Jan 10, 2017
ba29193
travis: always install gcc-5 and clang-3.8 as yaml does not allow to …
meyerj Jan 10, 2017
1f7354b
travis: move all build and install steps to script to avoid log folding
meyerj Jan 10, 2017
3f81772
Merge branch 'master' into travis/containerized-build
meyerj Jan 16, 2017
2ade374
Merge remote-tracking branch 'origin/master' into travis/containerize…
meyerj Jan 17, 2017
94842cb
travis: limit builds to whitelisted branches only
meyerj Jan 17, 2017
9eecc9a
Merge remote-tracking branch 'origin/master' into travis/containerize…
meyerj Oct 30, 2017
f652410
tests: disabled parts of taskthread_test/testPeriodic for Travis and …
meyerj Oct 30, 2017
d25bcf5
Merge branch 'master' into travis/containerized-build
meyerj Apr 16, 2019
f6b853c
use fully virtualized xenial instead of container-based trusty
francisco-miguel-almeida Apr 16, 2019
e0ec92a
.travis.yaml: exclude branches that start with toolchain-x.y but have…
meyerj Apr 16, 2019
d27c685
travis script cleanup, remove redundant builds and extend the branch …
francisco-miguel-almeida Apr 17, 2019
ba87571
make pointer addresses explicit in datasource test (clang copies the …
francisco-miguel-almeida Apr 17, 2019
7065e1f
tests: print and rethrow CORBA exceptions while running unit tests
meyerj Apr 17, 2019
9c4e2aa
.travis.yml: add macOS with xcode10.1 to the build matrix
meyerj Apr 18, 2019
927defe
remove superfluous builds and add ccache
francisco-miguel-almeida Apr 18, 2019
6f15799
properly enable ccache support on MacOSX environment
francisco-miguel-almeida May 2, 2019
3ea4809
Merge branch 'master' into travis/containerized-build
francisco-miguel-almeida May 2, 2019
63d0e07
tests: do not use the CORBA naming service for unit tests unless ORO_…
meyerj May 6, 2019
9ec596e
tests: set log level before __os_init
meyerj May 7, 2019
04c0d90
tests: run CORBA servers with Debug log level (temporarily)
meyerj May 7, 2019
c58115f
types: log known types in case of a lookup failure (temporarily)
meyerj May 7, 2019
da6d812
Merge branch 'master' into travis/containerized-build
meyerj May 8, 2019
c1405df
Merge branch 'master' into travis/containerized-build
francisco-miguel-almeida May 23, 2019
5c44a0a
Merge branch 'master' into travis/containerized-build
meyerj Oct 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 72 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,79 @@
sudo: required
dist: trusty
language:
- cpp
compiler:
- gcc
language: cpp

cache: ccache

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libxml-xpath-perl
- libboost-all-dev
- omniorb
- omniidl
- omniorb-nameserver
- libomniorb4-dev
- pkg-config
- clang-3.8

env:
global:
- EXTRA_CMAKE_ARGS="-DENABLE_TESTS=ON -DENABLE_CORBA=ON -DCORBA_IMPLEMENTATION=OMNIORB"
- BOOST_TEST_LOG_LEVEL=message
- CFLAGS="-Wall -Wextra -Wno-unused-parameter"

matrix:
include:
- os: linux
dist: xenial
env: COMPILER=gcc CXXFLAGS="-std=c++03 -Wall -Wextra -Wno-unused-parameter"
- os: linux
dist: xenial
env: COMPILER=gcc CXXFLAGS="-std=c++11 -Wall -Wextra -Wno-unused-parameter"
- os: linux
dist: xenial
env: COMPILER=clang-3.8 CXXFLAGS="-std=c++11 -Wall -Wextra -Wno-unused-parameter"
- os: linux
dist: xenial
env: COMPILER=clang CXXFLAGS="-std=c++11 -Wall -Wextra -Wno-unused-parameter"
- os: osx
osx_image: xcode10.1

branches:
only:
- master
- /^toolchain-[\d\.]+[\d]$/

before_install:
# Update package indexes and install dependencies
- sudo apt-get update -qq
- sudo apt-get install -qq -y libxml-xpath-perl libboost-all-dev omniorb omniidl omniorb-nameserver libomniorb4-dev pkg-config

install:
- export EXTRA_CMAKE_ARGS="-DENABLE_TESTS=ON -DENABLE_CORBA=ON -DCORBA_IMPLEMENTATION=OMNIORB"
- export CFLAGS="-std=c99 -Wall -Wextra -Wno-unused-parameter"
- export CXXFLAGS="-std=c++11 -Wall -Wextra -Wno-unused-parameter"
# Set C/C++ compiler
- |
if [[ "${COMPILER}" != "" ]]; then
export CC=${COMPILER}
if [[ "${COMPILER}" == "gcc"* ]]; then
export CXX=${COMPILER/gcc/g++}
elif [[ "${COMPILER}" == "clang"* ]]; then
export CXX=${COMPILER/clang/clang++}
fi
${CC} --version
${CXX} --version
fi

# Install HomeBrew dependencies (macOS only)
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew reinstall boost cmake ccache omniorb
export PATH="/use/local/opt/ccache/libexec:$PATH"
fi

# Create build directory
- mkdir -p build && cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/install $EXTRA_CMAKE_ARGS
- make -j2 install

script:
# Build and install RTT
- cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/install ${EXTRA_CMAKE_ARGS}
- make -j2 install

# Run tests
- export BOOST_TEST_LOG_LEVEL=message
- export ORBtraceExceptions=1
Expand Down
2 changes: 2 additions & 0 deletions rtt/types/TypeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "../internal/DataSourceTypeInfo.hpp"
#include "../internal/ConnFactory.hpp"
#include "TypeTransporter.hpp"
#include "TypeInfoRepository.hpp"

#include "rtt-config.h"

Expand Down Expand Up @@ -159,6 +160,7 @@ namespace RTT
else {
log(Warning) << "The protocol with id "<<protocol_id<<" did not register a fall-back handler for unknown types!"<<endlog();
log(Warning) << " triggered by: "<< getTypeName() << " which does not have a transport."<<endlog();
TypeInfoRepository::Instance()->logTypeInfo();
return 0; // That transport did not register a fall-back !
}
}
Expand Down
7 changes: 6 additions & 1 deletion tests/corba_ipc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ class TheServer : public TaskContext, public OperationsFixture
ports()->addEventPort( mi1 );
ports()->addPort( mo1 );
this->createOperationCallerFactories( this );
ts = corba::TaskContextServer::Create( this, /* use_naming = */ true );
#if ORO_NO_EMIT_CORBA_IOR
const bool use_naming = true;
#else
const bool use_naming = false;
#endif
ts = corba::TaskContextServer::Create( this, use_naming );
this->start();
addOperation("callBackPeer", &TheServer::callBackPeer, this,ClientThread);
addOperation("callBackPeerOwn", &TheServer::callBackPeer, this,OwnThread);
Expand Down
96 changes: 54 additions & 42 deletions tests/corba_ipc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,12 @@ BOOST_FIXTURE_TEST_SUITE( CorbaIPCTestSuite, CorbaTest )

BOOST_AUTO_TEST_CASE( testRemoteOperationCallerC )
{
tp = corba::TaskContextProxy::Create( "peerRMC", /* is_ior = */ false ); // no-ior
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerRMC.ior");
BOOST_REQUIRE( tp );
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerRMC.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerRMC", /* is_ior = */ false);
BOOST_REQUIRE(tp);

// This test tests 'transparant' remote invocation of Orocos internal::OperationCallerC objects.
internal::OperationCallerC mc;
Expand All @@ -262,10 +264,13 @@ BOOST_AUTO_TEST_CASE( testRemoteOperationCallerC )

BOOST_AUTO_TEST_CASE( testRemoteOperationCaller )
{
tp = corba::TaskContextProxy::Create( "peerRM" , /* is_ior = */ false);
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerRM.ior");
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerRM.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerRM", /* is_ior = */ false);
BOOST_REQUIRE(tp);

// This test tests 'transparant' remote invocation of Orocos methods.
// This requires the internal::RemoteOperationCaller class, which does not work yet.
RTT::OperationCaller<double(void)> m0 = tp->provides("methods")->getOperation("m0");
Expand All @@ -287,9 +292,11 @@ BOOST_AUTO_TEST_CASE( testRemoteOperationCaller )
*/
BOOST_AUTO_TEST_CASE( testRemoteOperationCallerCallback )
{
tp = corba::TaskContextProxy::Create( "peerRMCb" , /* is_ior = */ false);
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerRMC.ior");
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerRMCb.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerRMCb", /* is_ior = */ false);
BOOST_REQUIRE(tp);

BOOST_REQUIRE( RTT::internal::DataSourceTypeInfo<TaskContext*>::getTypeInfo() != 0 );
Expand All @@ -308,9 +315,12 @@ BOOST_AUTO_TEST_CASE( testRemoteOperationCallerCallback )
BOOST_AUTO_TEST_CASE( testAnyOperationCaller )
{
double d;
tp = corba::TaskContextProxy::Create( "peerAM" , /* is_ior = */ false);
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerAM.ior");
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerAM.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerAM", /* is_ior = */ false);
BOOST_REQUIRE(tp);

BOOST_REQUIRE(tp);
s = tp->server();
Expand Down Expand Up @@ -379,9 +389,12 @@ BOOST_AUTO_TEST_CASE( testAnyOperationCaller )

BOOST_AUTO_TEST_CASE(testDataFlowInterface)
{
tp = corba::TaskContextProxy::Create( "peerDFI" , /* is_ior = */ false);
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerDFI.ior");
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerDFI.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerDFI", /* is_ior = */ false);
BOOST_REQUIRE(tp);

BOOST_REQUIRE(tp);
corba::CDataFlowInterface_var ports = tp->server()->ports();
Expand All @@ -407,10 +420,13 @@ BOOST_AUTO_TEST_CASE(testDataFlowInterface)

BOOST_AUTO_TEST_CASE( testPortConnections )
{
// This test tests the differen port-to-port connections.
tp = corba::TaskContextProxy::Create( "peerPC", /* is_ior = */ false);
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerPC.ior");
// This test tests the different port-to-port connections.
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerPC.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerPC", /* is_ior = */ false);
BOOST_REQUIRE(tp);

BOOST_REQUIRE(tp);

Expand Down Expand Up @@ -499,9 +515,12 @@ BOOST_AUTO_TEST_CASE( testPortConnections )
BOOST_AUTO_TEST_CASE( testPortProxying )
{
// This test creates connections between local and remote ports.
tp = corba::TaskContextProxy::Create( "peerPP" , /* is_ior = */ false);
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerPP.ior");
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerPP.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerPP", /* is_ior = */ false);
BOOST_REQUIRE(tp);

BOOST_REQUIRE(tp);

Expand Down Expand Up @@ -563,16 +582,13 @@ BOOST_AUTO_TEST_CASE( testPortProxying )

BOOST_AUTO_TEST_CASE( testDataHalfs )
{
if(std::getenv("CI") != NULL) {
BOOST_TEST_MESSAGE("Skipping testDataHalfs because it can fail on integration servers.");
return;
}

double result;
// This test tests the differen port-to-port connections.
tp = corba::TaskContextProxy::Create( "peerDH" , /* is_ior = */ false);
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerDH.ior");
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerDH.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerDH", /* is_ior = */ false);
BOOST_REQUIRE(tp);

BOOST_REQUIRE(tp);

Expand Down Expand Up @@ -631,17 +647,13 @@ BOOST_AUTO_TEST_CASE( testDataHalfs )

BOOST_AUTO_TEST_CASE( testBufferHalfs )
{
if(std::getenv("CI") != NULL) {
BOOST_TEST_MESSAGE("Skipping testBufferHalfs because it can fail on integration servers.");
return;
}

double result;

// This test tests the differen port-to-port connections.
tp = corba::TaskContextProxy::Create( "peerBH" , /* is_ior = */ false);
if (!tp )
tp = corba::TaskContextProxy::CreateFromFile( "peerBH.ior");
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "peerBH.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::Create( "peerBH", /* is_ior = */ false);
BOOST_REQUIRE(tp);

BOOST_REQUIRE(tp);

Expand Down
7 changes: 6 additions & 1 deletion tests/corba_mqueue_ipc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ class TheServer : public TaskContext
ports()->addEventPort( mi1 );
ports()->addPort( mo1 );
this->start();
ts = corba::TaskContextServer::Create( this, /* use_naming = */ true );
#if ORO_NO_EMIT_CORBA_IOR
const bool use_naming = true;
#else
const bool use_naming = false;
#endif
ts = corba::TaskContextServer::Create( this, use_naming );
}
~TheServer() {
this->stop();
Expand Down
7 changes: 4 additions & 3 deletions tests/corba_mqueue_ipc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ BOOST_AUTO_TEST_CASE( testPortConnections )
{
// This test tests the different port-to-port connections.
ts = corba::TaskContextServer::Create( tc, /* use_naming = */ false );
tp = corba::TaskContextProxy::Create( "other", /* is_ior = */ false );
#ifndef ORO_NO_EMIT_CORBA_IOR
tp = corba::TaskContextProxy::CreateFromFile( "other.ior");
#endif
if (!tp)
tp = corba::TaskContextProxy::CreateFromFile( "other.ior");

tp = corba::TaskContextProxy::Create( "other", /* is_ior = */ false);
BOOST_REQUIRE(tp);

// Create a default CORBA policy specification
Expand Down
4 changes: 2 additions & 2 deletions tests/datasource_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ BOOST_AUTO_TEST_CASE( testArrayPartDataSource )
index->set( 3 );
d->set( 'L' );
BOOST_CHECK_EQUAL( "WorLd", btype.c );
BOOST_CHECK( strcmp( &d->set(), &abase->get().c[3]) == 0 );
BOOST_CHECK_EQUAL( &d->set(), &btype.c[3] );
BOOST_CHECK( strcmp( &d->set(), abase->get().c + 3) == 0 );
BOOST_CHECK_EQUAL( &d->set(), btype.c + 3 );
}


Expand Down
4 changes: 2 additions & 2 deletions tests/setup_corba.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

int main(int argc, char** argv)
{
int i = system("[ ! -r ./corba-ipc-server ] || ./corba-ipc-server &");
i = system("[ ! -r ./corba-mqueue-ipc-server ] || ./corba-mqueue-ipc-server &");
int i = system("[ ! -r ./corba-ipc-server ] || ORO_LOGLEVEL=6 ./corba-ipc-server &");
i = system("[ ! -r ./corba-mqueue-ipc-server ] || ORO_LOGLEVEL=6 ./corba-mqueue-ipc-server &");
usleep(500000);
return i;
}
1 change: 1 addition & 0 deletions tests/tasks_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ BOOST_AUTO_TEST_CASE( testAffinity )
BOOST_TEST_MESSAGE("Skipping testAffinity because it can fail on integration servers.");
return;
}

// this test is kind of irrelevant with only 1 CPU
int numCPU = sysconf( _SC_NPROCESSORS_ONLN );
if (1 < numCPU)
Expand Down
17 changes: 11 additions & 6 deletions tests/taskthread_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "taskthread_test.hpp"

#include <cstdlib>
#include <iostream>

#include <extras/Activities.hpp>
Expand Down Expand Up @@ -235,12 +236,16 @@ BOOST_AUTO_TEST_CASE( testPeriodicActivity )
}

// Different CPU affinity
unsigned cpu_affinity = 1; // first CPU only
if ( mtask.thread()->getCpuAffinity() != (unsigned) ~0 &&
mtask.thread()->getCpuAffinity() != cpu_affinity ) {
PeriodicActivity m4task(ORO_SCHED_OTHER, 15, 0.01, cpu_affinity);
BOOST_CHECK( mtask.thread() != m4task.thread() );
BOOST_CHECK_EQUAL( cpu_affinity, m4task.thread()->getCpuAffinity() );
if (std::getenv("CI") != NULL) {
BOOST_TEST_MESSAGE("Skipping CPU affinity test in testPeriodic because it can fail on integration servers.");
} else {
unsigned cpu_affinity = 1; // first CPU only
if ( mtask.thread()->getCpuAffinity() != (unsigned) ~0 &&
mtask.thread()->getCpuAffinity() != cpu_affinity ) {
PeriodicActivity m4task(ORO_SCHED_OTHER, 15, 0.01, cpu_affinity);
BOOST_CHECK( mtask.thread() != m4task.thread() );
BOOST_CHECK_EQUAL( cpu_affinity, m4task.thread()->getCpuAffinity() );
}
}

// Starting thread if thread not running
Expand Down
Loading