diff --git a/.travis.yml b/.travis.yml index 634faf78..5c96ab62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,31 @@ -language: cpp -dist: xenial - -compiler: - - gcc - - clang -os: - - linux - - osx +language: bash matrix: - exclude: - # GCC fails on recent Travis OSX images. - - compiler: gcc - os: osx + include: + # macOS + - os: osx + compiler: clang + script: make test -script: python test/run.py + # Linux + - os: linux + dist: xenial + script: python test/run.py + env: + - CC=clang + - CXX=clang++ + + - os: linux + dist: xenial + script: python test/run.py + env: + - CC=clang + - CXX=clang++ + + # Windows + - os: windows + env: + - CMAKE_PATH="/c/Program Files/CMake/bin" + script: + - export PATH=$CMAKE_PATH:$PATH + - python test/run.py diff --git a/docker/Dockerfile.ubuntu_xenial b/docker/Dockerfile.ubuntu_xenial index e24fe498..1e87694d 100644 --- a/docker/Dockerfile.ubuntu_xenial +++ b/docker/Dockerfile.ubuntu_xenial @@ -1,24 +1,22 @@ -# Build time -FROM ubuntu:xenial as build +FROM fedora:30 as build -ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update -RUN apt-get -y install wget +RUN yum install -y gcc-g++ +RUN yum install -y cmake +RUN yum install -y make +RUN yum install -y openssl-devel + +RUN yum install -y wget RUN mkdir -p /tmp/cmake WORKDIR /tmp/cmake RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz RUN tar zxf cmake-3.14.0-Linux-x86_64.tar.gz -RUN apt-get -y install g++ -RUN apt-get -y install libssl-dev -RUN apt-get -y install libz-dev -RUN apt-get -y install make -RUN apt-get -y install python - -COPY . . - ARG CMAKE_BIN_PATH=/tmp/cmake/cmake-3.14.0-Linux-x86_64/bin ENV PATH="${CMAKE_BIN_PATH}:${PATH}" -# RUN ["make"] +RUN yum install -y python +RUN yum install -y libtsan + +COPY . . RUN ["make", "test"] +# RUN ["make"] diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f4a74388..7fb4acca 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -31,19 +31,20 @@ set (SOURCES ../third_party/msgpack11/msgpack11.cpp ../ws/ixcore/utils/IXCoreLogger.cpp - IXDNSLookupTest.cpp IXSocketTest.cpp IXSocketConnectTest.cpp IXWebSocketServerTest.cpp - IXWebSocketPingTest.cpp IXWebSocketTestConnectionDisconnection.cpp IXUrlParserTest.cpp + IXWebSocketServerTest.cpp ) # Some unittest don't work on windows yet -if (NOT WIN32) +if (UNIX) list(APPEND SOURCES IXWebSocketPingTimeoutTest.cpp + IXDNSLookupTest.cpp + IXWebSocketPingTest.cpp cmd_websocket_chat.cpp ) endif() diff --git a/test/run.py b/test/run.py index 30b441ce..b5898b53 100755 --- a/test/run.py +++ b/test/run.py @@ -103,7 +103,8 @@ def runCMake(sanitizer, buildDir): if platform.system() == 'Windows': #generator = '"NMake Makefiles"' - generator = '"Visual Studio 16 2019"' + #generator = '"Visual Studio 16 2019"' + generator = '"Visual Studio 15 2017"' else: generator = '"Unix Makefiles"'