diff --git a/core/unittest/server/test_config.cpp b/core/unittest/server/test_config.cpp index 791876ee8bb40ed46dd3413ab932ee72b7625286..8705555d12e1c95d09a0f4589b254d44b1b3ed58 100644 --- a/core/unittest/server/test_config.cpp +++ b/core/unittest/server/test_config.cpp @@ -17,6 +17,7 @@ #include #include +#include #include "config/YamlConfigMgr.h" #include "server/Config.h" @@ -67,9 +68,9 @@ TEST_F(ConfigTest, CONFIG_TEST) { server_config.SetValue("float_test", "2.5"); double dbl = server_config.GetDoubleValue("float_test"); - ASSERT_LE(abs(dbl - 2.5), std::numeric_limits::epsilon()); + ASSERT_LE(std:fabs(dbl - 2.5), std::numeric_limits::epsilon()); float flt = server_config.GetFloatValue("float_test"); - ASSERT_LE(abs(flt - 2.5), std::numeric_limits::epsilon()); + ASSERT_LE(std:fabs(flt - 2.5), std::numeric_limits::epsilon()); server_config.SetValue("bool_test", "true"); bool blt = server_config.GetBoolValue("bool_test"); diff --git a/docker/build_env/cpu/centos7/Dockerfile b/docker/build_env/cpu/centos7/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2e564b03239a7b52d70a5f6b5b7bf1e1b2e4ca51 --- /dev/null +++ b/docker/build_env/cpu/centos7/Dockerfile @@ -0,0 +1,20 @@ +FROM centos:centos7 + +RUN yum install -y epel-release centos-release-scl-rh && yum install -y wget curl which && \ + wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \ + yum install -y ccache make automake git python3-pip libcurl-devel python3-devel boost-static mysql-devel \ + devtoolset-6-gcc devtoolset-6-gcc-c++ devtoolset-6-gcc-gfortran llvm-toolset-7.0-clang llvm-toolset-7.0-clang-tools-extra lcov \ + && \ + rm -rf /var/cache/yum/* + +RUN echo "source scl_source enable devtoolset-6" >> /etc/profile.d/devtoolset-6.sh +RUN echo "source scl_source enable llvm-toolset-7.0" >> /etc/profile.d/llvm-toolset-7.sh + +ENV CLANG_TOOLS_PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin" + +COPY docker-entrypoint.sh /app/docker-entrypoint.sh + +WORKDIR /root + +ENTRYPOINT [ "/app/docker-entrypoint.sh" ] +CMD [ "start" ] \ No newline at end of file diff --git a/docker/build_env/cpu/centos7/docker-entrypoint.sh b/docker/build_env/cpu/centos7/docker-entrypoint.sh new file mode 100755 index 0000000000000000000000000000000000000000..1e85e7e9e1bb20a0849530fb3b9d4a6c02a13d33 --- /dev/null +++ b/docker/build_env/cpu/centos7/docker-entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +if [ "$1" = 'start' ]; then + tail -f /dev/null +fi + +exec "$@" +