Commit 0cbdf32f authored by Michaël Roynard's avatar Michaël Roynard

Fix CI & packaging

parent 165dfee7
Pipeline #4141 failed with stage
in 3 minutes and 39 seconds
variables:
CONAN_PROFILE: "gcc7" # profile to use with conan
# CONAN_PUBLIC_REMOTE_NAME: "lrde-public" # Conan remote name
# CONAN_PUBLIC_REMOTE_URL: "https://artifactory.lrde.epita.fr/artifactory/api/conan/lrde-public" # Conan remote name
# CONAN_PRIVATE_REMOTE_NAME: "lrde-private" # Conan remote name
# CONAN_PRIVATE_REMOTE_URL: "http://artifactory.lrde.epita.fr/artifactory/api/conan/lrde-private" # Conan remote name
# CONAN_USER: "mroynard" # Conan user name
# CONAN_API_KEY: "AKCp5bAiaob11EFd9cnDkF1LJBqG5QDgTgbQttVmSfgokeLK4yE6AQ9KM7WyUqBCK1MwTp9H1" # Conan API key on public bintray repositories
CONAN_PRIVATE_REMOTE_NAME: "dutiona-lrde" # Conan remote name
CONAN_PRIVATE_REMOTE_URL: "https://api.bintray.com/conan/dutiona/lrde" # Conan remote name
CONAN_USER: "dutiona" # Conan user name
CONAN_API_KEY: "e2a665548385e82bf1ecbb4739d3582b83b8235f" # Conan API key on public bintray repositories
NAME: "gtest-constexpr-ext" # Conan package name
TAG: "stable" # Conan tag
VERSION: "0.1" # Version to build
CONAN_PROFILE: "gcc7" # profile to use with conan
CC: "gcc-7" # C compiler
CXX: "gcc-7" # C++ compiler
# CONAN_PUBLIC_REMOTE_NAME: "lrde-public" # Conan remote name
# CONAN_PUBLIC_REMOTE_URL: "https://artifactory.lrde.epita.fr/artifactory/api/conan/lrde-public" # Conan remote name
# CONAN_PRIVATE_REMOTE_NAME: "lrde-private" # Conan remote name
# CONAN_PRIVATE_REMOTE_URL: "http://artifactory.lrde.epita.fr/artifactory/api/conan/lrde-private" # Conan remote name
# CONAN_USER: "mroynard" # Conan user name
# CONAN_API_KEY: "AKCp5bAiaob11EFd9cnDkF1LJBqG5QDgTgbQttVmSfgokeLK4yE6AQ9KM7WyUqBCK1MwTp9H1" # Conan API key on public bintray repositories
CONAN_PRIVATE_REMOTE_NAME: "dutiona-lrde" # Conan remote name
CONAN_PRIVATE_REMOTE_URL: "https://api.bintray.com/conan/dutiona/lrde" # Conan remote name
CONAN_USER: "dutiona" # Conan user name
CONAN_API_KEY: "e2a665548385e82bf1ecbb4739d3582b83b8235f" # Conan API key on public bintray repositories
NAME: "gtest-constexpr-ext" # Conan package name
TAG: "stable" # Conan tag
VERSION: "0.1" # Version to build
stages:
- package
......@@ -22,6 +24,10 @@ stages:
image: mroynard/ubuntu-toolset:stable
script:
- set -e
- export CC=$CC
- export CXX=$CXX
- $CC --version
- $CXX --version
- conan remote add $CONAN_PRIVATE_REMOTE_NAME $CONAN_PRIVATE_REMOTE_URL
- conan user
-p $CONAN_API_KEY
......@@ -43,16 +49,22 @@ distcheck-package-linux-gcc7:
distcheck-package-linux-gcc8:
<<: *distcheck-basic-package-linux
variables:
CC: "gcc-8"
CXX: "g++-8"
CONAN_PROFILE: "gcc8"
distcheck-package-linux-clang6:
<<: *distcheck-basic-package-linux
variables:
CC: "clang-6.0"
CXX: "clang++-6.0"
CONAN_PROFILE: "clang6"
# distcheck-package-linux-clang7:
# <<: *distcheck-basic-package-linux
# variables:
# CC: "clang-7"
# CXX: "clang++-7"
# CONAN_PROFILE: "clang7"
distcheck-package-linux-default:
......@@ -60,6 +72,10 @@ distcheck-package-linux-default:
image: mroynard/ubuntu-toolset:stable
script:
- set -e
- export CC=$CC
- export CXX=$CXX
- $CC --version
- $CXX --version
- conan remote add $CONAN_PRIVATE_REMOTE_NAME $CONAN_PRIVATE_REMOTE_URL
- conan user
-p $CONAN_API_KEY
......
......@@ -2,26 +2,28 @@
namespace {
template<auto &F, auto ... Args, auto = F(Args...)>
constexpr bool is_constexpr(int) {
template <auto& F, auto... Args, auto = F(Args...)>
constexpr bool is_constexpr(int)
{
return true;
}
template<auto &F, auto ... Args>
constexpr bool is_constexpr(...) {
template <auto& F, auto... Args>
constexpr bool is_constexpr(...)
{
return false;
}
}
} // namespace
#define ASSERT_COMPILETIME_EXPR(...) \
do { \
constexpr bool ret = is_constexpr<__VA_ARGS__>(0); \
ASSERT_TRUE(ret); \
} while(false);
#define ASSERT_COMPILETIME_EXPR(...) \
do { \
constexpr bool ret = is_constexpr<__VA_ARGS__>(0); \
ASSERT_TRUE(ret); \
} while (false);
#define ASSERT_RUNTIME_EXPR(...) \
do { \
constexpr bool ret = is_constexpr<__VA_ARGS__>(0); \
ASSERT_FALSE(ret); \
} while(false);
#define ASSERT_RUNTIME_EXPR(...) \
do { \
constexpr bool ret = is_constexpr<__VA_ARGS__>(0); \
ASSERT_FALSE(ret); \
} while (false);
project(PackageTest CXX)
cmake_minimum_required(VERSION 3.8.2)
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
find_package(gtest-constexpr-ext REQUIRED)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
add_executable(test_package test_package.cpp)
target_compile_features(test_package INTERFACE cxx_std_17)
target_link_libraries(test_package PRIVATE gtest-constexpr-ext::gtest-constexpr-ext)
target_link_libraries(test_package PRIVATE CONAN_PKG::gtest-constexpr-ext)
enable_testing()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment