Skip to content

Commit

Permalink
Removed all noexcept specs because they are invalid. Enhanced the tra…
Browse files Browse the repository at this point in the history
…vis script for more gcc builds.
  • Loading branch information
guangie88 committed Oct 20, 2017
1 parent db8b89b commit ea10cef
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 36 deletions.
99 changes: 67 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
dist: trusty
sudo: false
language: cpp

git:
submodules: true

addons:
apt:
sources:
Expand All @@ -11,39 +13,72 @@ addons:
- g++-5
- doxygen

matrix:
include:
# ubuntu 14.04, gcc-5
- env: VER=5
compiler: gcc
os: linux
dist: trusty
addons: { apt: { packages: ["g++-5", "doxygen"], sources: ["ubuntu-toolchain-r-test"] } }

# ubuntu 14.04, gcc-6
- env: VER=6
compiler: gcc
os: linux
dist: trusty
addons: { apt: { packages: ["g++-6", "doxygen"], sources: ["ubuntu-toolchain-r-test"] } }

# ubuntu 14.04, gcc-7
- env: VER=7
compiler: gcc
os: linux
dist: trusty
addons: { apt: { packages: ["g++-7", "doxygen"], sources: ["ubuntu-toolchain-r-test"] } }

install:
- DEPS="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS}
- |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew update
brew upgrade cmake
elif [ "${TRAVIS_OS_NAME}" = "linux" ]; then
travis_retry wget --no-check-certificate https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
bash cmake-3.8.2-Linux-x86_64.sh --skip-license --prefix="${DEPS}"
export PATH="${DEPS}/bin:${PATH}"
fi
# set the correct `CC` and `CXX` environment variables.
- |
if [ -n "${VER}" ]; then
export CC="${CC}-${VER}"
export CXX="${CXX}-${VER}"
fi
- ${CXX} --version
# directory for dependency installation.
- DEPS="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS}
# install newer cmake.
- |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew update
brew upgrade cmake
elif [ "${TRAVIS_OS_NAME}" = "linux" ]; then
travis_retry wget --no-check-certificate https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
bash cmake-3.8.2-Linux-x86_64.sh --skip-license --prefix="${DEPS}"
export PATH="${DEPS}/bin:${PATH}"
fi
script:
- export CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5
- git submodule update --init --recursive
- mkdir build-debug
- cd build-debug
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DSPDLOG_SETUP_INCLUDE_UNIT_TESTS=ON
- cmake --build . -- -j2
- cd ..
- mkdir build-release
- cd build-release
- cmake .. -DCMAKE_BUILD_TYPE=Release -DSPDLOG_SETUP_INCLUDE_UNIT_TESTS=ON -DCMAKE_INSTALL_PREFIX:PATH=install
- cmake --build . --target install -- -j2
- cd ..
- BUILDS=(Debug Release)
- mkdir build
- pushd build
- |
for BUILD in "${BUILDS[@]}"; do
(
set -x
cmake -DCMAKE_BUILD_TYPE="${BUILD}" \
-DCMAKE_INSTALL_PREFIX:PATH=install \
-DRUSTFP_INCLUDE_UNIT_TESTS=ON ..
)
cmake --build . --target install -- -j 2
./rustfp_unit_test -s
# ctest -V
done
- popd

after_success:
- doxygen Doxyfile

# run unit test and code coverage
- ./build-debug/spdlog_setup_unit_test -s
- ./build-release/spdlog_setup_unit_test -s
# - gcov ./build-debug/CMakeFiles/spdlog_setup_unit_test.dir/src/unit_test/unit_test.cpp.gcno
# - bash <(curl -s https://codecov.io/bash)

# generate document
- doxygen Doxyfile
# generate code coverage
#- gcov ./build-debug/CMakeFiles/rustfp_unit_test.dir/src/rustfp_unit_test/unit_test.cpp.gcno
#- bash <(curl -s https://codecov.io/bash)
8 changes: 4 additions & 4 deletions include/spdlog_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ namespace spdlog_setup {
* @return true if setup is successful, otherwise false.
*/
template <class... Ps>
auto from_file_with_tag_replacement(const std::string &pre_toml_path, Ps &&... ps) noexcept ->
auto from_file_with_tag_replacement(const std::string &pre_toml_path, Ps &&... ps) ->
::rustfp::Result<::rustfp::unit_t, std::string>;

/**
* Performs spdlog configuration setup from file.
* @param toml_path Path to the TOML configuration file path.
* @return true if setup is successful, otherwise false.
*/
auto from_file(const std::string &toml_path) noexcept ->
auto from_file(const std::string &toml_path) ->
::rustfp::Result<::rustfp::unit_t, std::string>;

// implementation section
Expand Down Expand Up @@ -871,7 +871,7 @@ namespace spdlog_setup {
}

template <class... Ps>
auto from_file_with_tag_replacement(const std::string &pre_toml_path, Ps &&... ps) noexcept ->
auto from_file_with_tag_replacement(const std::string &pre_toml_path, Ps &&... ps) ->
::rustfp::Result<::rustfp::unit_t, std::string> {

// fmt
Expand Down Expand Up @@ -922,7 +922,7 @@ namespace spdlog_setup {
}
}

inline auto from_file(const std::string &toml_path) noexcept ->
inline auto from_file(const std::string &toml_path) ->
::rustfp::Result<::rustfp::unit_t, std::string> {

// rustfp
Expand Down

0 comments on commit ea10cef

Please sign in to comment.