Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
66 changes: 51 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
os:
- linux
- osx
# Use travis docker infrastructure
sudo: false
# Use a recent OSX image
# cf.
# https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions
osx_image: xcode7.2
language: cpp
cache: ccache

env:
global:
- PREFIX=$HOME/prefix
- MY_CMAKE_OPTIONS="-DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$HOME/install"
- CTEST_OUTPUT_ON_FAILURE=1
- LINUX=false
- OSX=false

compiler:
- gcc
- clang

matrix:
exclude:
- os: osx
compiler: gcc

# Install a recent gcc and gcov,
# it will not be necessary once travis worker is based on ubuntu > 12.04.
# Install SWIG for bindings generation
Expand All @@ -36,13 +52,32 @@ addons:
- python3-dev
- clang-format-3.8

before_install:
# OS detection
# TODO: an explicit build matrix may be better but it has limitation, e.g.
# each matrix entry may only define a single env variable.
- if [ $TRAVIS_OS_NAME = linux ]; then export LINUX=true; fi
- if [ $TRAVIS_OS_NAME = osx ]; then export OSX=true; fi
install:
- wget https://codecov.io/bash -O $HOME/codecov; chmod +x $HOME/codecov
# This version of catch is known to work.
- wget --directory-prefix $PREFIX/include
https://raw.github.com/philsquared/Catch/v1.2.1/single_include/catch.hpp
- wget 'https://01.org/sites/default/files/asio-1.10.6.tar.gz'
- tar xf asio-1.10.6.tar.gz -C $PREFIX --strip-components=1
# Current limitations on OSX builds: no testing, no client-simulator
# (because we haven't found a straightforward way to have CMake find the
# python libraries (find_package(PythonLibs)).
- if $OSX; then
brew update;
for package in cmake; do
if brew list $package; then
brew outdated $package || brew upgrade $package;
else
brew install $package;
fi;
done;
fi

before_script:
- coverage=OFF
Expand All @@ -54,41 +89,42 @@ before_script:
coverage=ON;
export CCACHE_CPP2=1;
fi
- if $OSX; then export MY_CMAKE_OPTIONS+=" -DBUILD_TESTING=OFF -DPYTHON_BINDINGS=OFF"; fi

# how to build
script:
# Check coding style
- git ls-files | grep -E '\.[ch](pp)?$' | xargs clang-format-3.8 -i &&
git diff --exit-code || { git reset --hard; false; }
- if $LINUX; then (git ls-files | grep -E '\.[ch](pp)?$' | xargs clang-format-3.8 -i &&
git diff --exit-code || { git reset --hard; false; }); fi

- ( mkdir build_debug && cd build_debug &&
cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=${coverage} .. &&
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=${coverage} .. &&
make -j$(nproc) &&
CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalMemCheck )
(if $LINUX; then make ExperimentalTest ExperimentalMemCheck; fi) )
- ( mkdir build && cd build &&
cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release .. &&
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Release .. &&
make -j$(nproc) &&
CTEST_OUTPUT_ON_FAILURE=1 make test &&
(if $LINUX; then make test; fi) &&
make install &&
cpack --verbose -G DEB && dpkg --info *.deb)
(if $LINUX; then cpack --verbose -G DEB && dpkg --info *.deb; fi) )
- ( cd skeleton-subsystem &&
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install . &&
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Release . &&
make -j$(nproc) &&
CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalMemCheck &&
(if $LINUX; then make ExperimentalTest ExperimentalMemCheck; fi) &&
make install )
- ( cd tools/clientSimulator &&
echo "TODO - install the generated .deb instead of using ../install."
- if $LINUX; then ( cd tools/clientSimulator &&
echo "TODO - install the generated .deb instead of using \$HOME/install."
"This would permit to test the packaging" &&
cmake -DCMAKE_INSTALL_PREFIX=../install . &&
cmake $MY_CMAKE_OPTIONS . &&
make &&
make install )
make install ); fi
# Keep this last
- ( mkdir build_less_features && cd build_less_features &&
rm -rf $PREFIX/asio-1.10.6 &&
cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_BUILD_TYPE=Debug
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug
-DNETWORKING=OFF -DPYTHON_BINDINGS=OFF -DC_BINDINGS=OFF .. &&
make -j$(nproc) &&
CTEST_OUTPUT_ON_FAILURE=1 make test )
(if $LINUX; then make test; fi) )

after_success:
# Push coverage info on codecov.io.
Expand Down
20 changes: 10 additions & 10 deletions parameter/ArrayParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,30 @@ class CArrayParameter : public CParameter
CArrayParameter(const std::string &strName, const CTypeElement *pTypeElement);

// Instantiation, allocation
virtual size_t getFootPrint() const;
size_t getFootPrint() const override;

/// Value access
using CBaseParameter::access;
bool access(std::vector<bool> &abValues, bool bSet,
CParameterAccessContext &parameterAccessContext) const override final;
CParameterAccessContext &parameterAccessContext) const final;
bool access(std::vector<uint32_t> &auiValues, bool bSet,
CParameterAccessContext &parameterAccessContext) const override final;
CParameterAccessContext &parameterAccessContext) const final;
bool access(std::vector<int32_t> &aiValues, bool bSet,
CParameterAccessContext &parameterAccessContext) const override final;
CParameterAccessContext &parameterAccessContext) const final;
bool access(std::vector<double> &adValues, bool bSet,
CParameterAccessContext &parameterAccessContext) const override final;
CParameterAccessContext &parameterAccessContext) const final;
bool access(std::vector<std::string> &astrValues, bool bSet,
CParameterAccessContext &parameterAccessContext) const override final;
CParameterAccessContext &parameterAccessContext) const final;

protected:
// User set/get
virtual bool accessValue(CPathNavigator &pathNavigator, std::string &strValue, bool bSet,
CParameterAccessContext &parameterAccessContext) const;
bool accessValue(CPathNavigator &pathNavigator, std::string &strValue, bool bSet,
CParameterAccessContext &parameterAccessContext) const override;
// Used for simulation and virtual subsystems
virtual void setDefaultValues(CParameterAccessContext &parameterAccessContext) const;
void setDefaultValues(CParameterAccessContext &parameterAccessContext) const override;

// Element properties
virtual void showProperties(std::string &strResult) const;
void showProperties(std::string &strResult) const override;

private:
// Array length
Expand Down
12 changes: 6 additions & 6 deletions parameter/BaseParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ class CBaseParameter : public CInstanceConfigurableElement
CBaseParameter(const std::string &strName, const CTypeElement *pTypeElement);

// XML configuration settings parsing/composing
virtual bool serializeXmlSettings(
bool serializeXmlSettings(
CXmlElement &xmlConfigurationSettingsElementContent,
CConfigurationAccessContext &configurationAccessContext) const;
CConfigurationAccessContext &configurationAccessContext) const override;

// Check element is a parameter
virtual bool isParameter() const;
bool isParameter() const override;

// Boolean access
virtual bool access(bool &bValue, bool bSet,
Expand Down Expand Up @@ -85,12 +85,12 @@ class CBaseParameter : public CInstanceConfigurableElement
CParameterAccessContext &parameterAccessContext) const;

void structureToXml(CXmlElement &xmlElement,
CXmlSerializingContext &serializingContext) const override final;
CXmlSerializingContext &serializingContext) const final;

protected:
// Parameter Access
virtual bool accessValue(CPathNavigator &pathNavigator, std::string &strValue, bool bSet,
CParameterAccessContext &parameterAccessContext) const;
bool accessValue(CPathNavigator &pathNavigator, std::string &strValue, bool bSet,
CParameterAccessContext &parameterAccessContext) const override;

// Actual value access (to be implemented by derived)
virtual bool doSetValue(const std::string &strValue, size_t offset,
Expand Down
18 changes: 9 additions & 9 deletions parameter/BitParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ class CBitParameter : public CBaseParameter
CBitParameter(const std::string &strName, const CTypeElement *pTypeElement);

// Instantiation, allocation
virtual size_t getFootPrint() const;
size_t getFootPrint() const override;

// Type
virtual Type getType() const;
Type getType() const override;

/// Value access
// Boolean access
bool access(bool &bValue, bool bSet,
CParameterAccessContext &parameterAccessContext) const override final;
CParameterAccessContext &parameterAccessContext) const final;

// Integer Access
bool access(uint32_t &uiValue, bool bSet,
CParameterAccessContext &parameterAccessContext) const override final;
CParameterAccessContext &parameterAccessContext) const final;

// AreaConfiguration creation
virtual CAreaConfiguration *createAreaConfiguration(const CSyncerSet *pSyncerSet) const;
CAreaConfiguration *createAreaConfiguration(const CSyncerSet *pSyncerSet) const override;

// Size
size_t getBelongingBlockSize() const;
Expand All @@ -64,10 +64,10 @@ class CBitParameter : public CBaseParameter

private:
// String Access
virtual bool doSetValue(const std::string &strValue, size_t offset,
CParameterAccessContext &parameterAccessContext) const;
virtual void doGetValue(std::string &strValue, size_t offset,
CParameterAccessContext &parameterAccessContext) const;
bool doSetValue(const std::string &strValue, size_t offset,
CParameterAccessContext &parameterAccessContext) const override;
void doGetValue(std::string &strValue, size_t offset,
CParameterAccessContext &parameterAccessContext) const override;

// Generic Access
template <typename type>
Expand Down
9 changes: 5 additions & 4 deletions parameter/BitParameterBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,19 @@ class CBitParameterBlock : public CInstanceConfigurableElement
CBitParameterBlock(const std::string &strName, const CTypeElement *pTypeElement);

// Instantiation, allocation
virtual size_t getFootPrint() const;
size_t getFootPrint() const override;

// Type
virtual Type getType() const;
Type getType() const override;

// Size
size_t getSize() const;

// Used for simulation and virtual subsystems
virtual void setDefaultValues(CParameterAccessContext &parameterAccessContext) const;
void setDefaultValues(CParameterAccessContext &parameterAccessContext) const override;

void structureToXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const
void structureToXml(CXmlElement &xmlElement,
CXmlSerializingContext &serializingContext) const override
{
xmlElement.setAttribute("Size", getSize() * 8);
CInstanceConfigurableElement::structureToXml(xmlElement, serializingContext);
Expand Down
11 changes: 6 additions & 5 deletions parameter/BitParameterBlockType.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,19 @@ class CBitParameterBlockType : public CTypeElement
size_t getSize() const;

// From IXmlSink
virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext);
bool fromXml(const CXmlElement &xmlElement,
CXmlSerializingContext &serializingContext) override;

// From IXmlSource
virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const;
void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override;

// CElement
virtual std::string getKind() const;
std::string getKind() const override;

private:
virtual bool childrenAreDynamic() const;
bool childrenAreDynamic() const override;
// Instantiation
virtual CInstanceConfigurableElement *doInstantiate() const;
CInstanceConfigurableElement *doInstantiate() const override;

// Size in bytes
size_t _size{0};
Expand Down
11 changes: 6 additions & 5 deletions parameter/BitParameterType.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ class CBitParameterType : public CTypeElement
CBitParameterType(const std::string &strName);

// From IXmlSink
virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext);
bool fromXml(const CXmlElement &xmlElement,
CXmlSerializingContext &serializingContext) override;

// From IXmlSource
virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const;
void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override;
/// Conversion
// String
bool toBlackboard(const std::string &strValue, uint64_t &uiValue,
Expand All @@ -66,10 +67,10 @@ class CBitParameterType : public CTypeElement
size_t getBitSize() const;

// Element properties
virtual void showProperties(std::string &strResult) const;
void showProperties(std::string &strResult) const override;

// CElement
virtual std::string getKind() const;
std::string getKind() const override;

/**
* Get the position of the bit within the bit parameter block.
Expand All @@ -80,7 +81,7 @@ class CBitParameterType : public CTypeElement
size_t getBitPos() const { return _bitPos; }
private:
// Instantiation
virtual CInstanceConfigurableElement *doInstantiate() const;
CInstanceConfigurableElement *doInstantiate() const override;
// Max encodable value
uint64_t getMaxEncodableValue() const;
// Biwise mask
Expand Down
4 changes: 2 additions & 2 deletions parameter/BitwiseAreaConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ class CBitwiseAreaConfiguration : public CAreaConfiguration

private:
// Blackboard copies
virtual void copyTo(CParameterBlackboard *pToBlackboard, size_t offset) const;
virtual void copyFrom(const CParameterBlackboard *pFromBlackboard, size_t offset);
void copyTo(CParameterBlackboard *pToBlackboard, size_t offset) const override;
void copyFrom(const CParameterBlackboard *pFromBlackboard, size_t offset) override;
};
28 changes: 14 additions & 14 deletions parameter/BooleanParameterType.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ class CBooleanParameterType : public CParameterType
{
public:
CBooleanParameterType(const std::string &strName);
virtual ~CBooleanParameterType() = default;
~CBooleanParameterType() override = default;

// Kind
virtual std::string getKind() const;
std::string getKind() const override;

/// Conversion
// String
virtual bool toBlackboard(const std::string &strValue, uint32_t &uiValue,
CParameterAccessContext &parameterAccessContext) const;
virtual bool fromBlackboard(std::string &strValue, const uint32_t &uiValue,
CParameterAccessContext &parameterAccessContext) const;
bool toBlackboard(const std::string &strValue, uint32_t &uiValue,
CParameterAccessContext &parameterAccessContext) const override;
bool fromBlackboard(std::string &strValue, const uint32_t &uiValue,
CParameterAccessContext &parameterAccessContext) const override;
// Boolean
virtual bool toBlackboard(bool bUserValue, uint32_t &uiValue,
CParameterAccessContext &parameterAccessContext) const;
virtual bool fromBlackboard(bool &bUserValue, uint32_t uiValue,
CParameterAccessContext &parameterAccessContext) const;
bool toBlackboard(bool bUserValue, uint32_t &uiValue,
CParameterAccessContext &parameterAccessContext) const override;
bool fromBlackboard(bool &bUserValue, uint32_t uiValue,
CParameterAccessContext &parameterAccessContext) const override;
// Integer
virtual bool toBlackboard(uint32_t uiUserValue, uint32_t &uiValue,
CParameterAccessContext &parameterAccessContext) const;
virtual bool fromBlackboard(uint32_t &uiUserValue, uint32_t uiValue,
CParameterAccessContext &parameterAccessContext) const;
bool toBlackboard(uint32_t uiUserValue, uint32_t &uiValue,
CParameterAccessContext &parameterAccessContext) const override;
bool fromBlackboard(uint32_t &uiUserValue, uint32_t uiValue,
CParameterAccessContext &parameterAccessContext) const override;
};
2 changes: 1 addition & 1 deletion parameter/Component.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ class CComponent : public CInstanceConfigurableElement
}

// Type
virtual Type getType() const { return EComponent; }
Type getType() const override { return EComponent; }
};
Loading