diff --git a/.travis.yml b/.travis.yml index 9a47d329..63d989c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: cpp os: - linux - osx + - windows compiler: - gcc - clang @@ -10,22 +11,49 @@ env: - DEBUG="nodebug" COVERAGE="nocoverage" - LINKING="static" before_install: + - ps -ef + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then ps -Wla | sort ; fi - eval "${MATRIX_EVAL}" - - export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" - - export PATH=$PATH:/usr/local/lib - - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib - - export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib"; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export PATH=$PATH:/usr/local/lib; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install info install-info; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install codecov; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install gcovr; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install cppcheck; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then export CFLAGS='-mtune=generic'; fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install -r --no-progress -y msys2 make; fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then PATH=$PATH:/c/tools/msys64/usr/bin/ ; fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell -executionpolicy bypass "pacman -Syu --noconfirm autoconf libtool automake make autoconf-archive pkg-config mingw-w64-x86_64-libsystre" ; fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then + ln -s /c/tools/msys64/usr/share/autoconf* /usr/share/ ; + ln -s /c/tools/msys64/usr/share/automake* /usr/share/ ; + ln -s /c/tools/msys64/usr/share/aclocal* /usr/share/ ; + ln -s /c/tools/msys64/usr/share/libtool* /usr/share/ ; + ln -s /c/tools/msys64/usr/share/pkgconfig /usr/share/ ; + ln -s /c/tools/msys64/usr/bin/autom4te /usr/bin/ ; + ln -s /c/tools/msys64/usr/bin/autoconf /usr/bin/ ; + ln -s /c/tools/msys64/usr/bin/autoheader /usr/bin/ ; + ln -s /c/tools/msys64/usr/bin/m4 /usr/bin/ ; + + PATH=$PATH:/c/tools/msys64/usr/bin/ ; + export SHELL=/usr/bin/sh.exe ; + fi - curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz - - tar -xvzf libmicrohttpd-0.9.59.tar.gz + - tar -xzf libmicrohttpd-0.9.59.tar.gz - cd libmicrohttpd-0.9.59 - - if [[ "$ARM_ARCH_DIR" != "" ]]; then ./configure --build `./config.guess` --host $ARM_ARCH_DIR --disable-examples; else ./configure --disable-examples; fi + - if [[ "$ARM_ARCH_DIR" != "" ]]; then + ./configure --build `./config.guess` --host $ARM_ARCH_DIR --disable-examples; + elif [[ "$TRAVIS_OS_NAME" = "windows" ]]; then + ./configure --prefix=/usr --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --disable-examples --disable-https --enable-shared --enable-static ; + else + ./configure --disable-examples; + fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then find . -name Makefile -type f -exec sed -i "s/\${SHELL}/\/usr\/bin\/sh.exe/" "{}" + ; fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then find . -name Makefile -type f -exec sed -i "s/\$(SHELL)/\/usr\/bin\/sh.exe/" "{}" + ; fi - make - - sudo make install + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then make install; else sudo make install; fi - cd .. - if [ "$BUILD_TYPE" = "asan" ]; then export CFLAGS='-fsanitize=address'; export CXXLAGS='-fsanitize=address'; export LDFLAGS='-fsanitize=address'; fi - if [ "$BUILD_TYPE" = "msan" ]; then export CFLAGS='-fsanitize=memory'; export CXXLAGS='-fsanitize=memory'; export LDFLAGS='-fsanitize=memory'; fi @@ -33,6 +61,7 @@ before_install: - if [ "$BUILD_TYPE" = "tsan" ]; then export CFLAGS='-fsanitize=thread'; export CXXLAGS='-fsanitize=thread'; export LDFLAGS='-fsanitize=thread'; fi - if [ "$BUILD_TYPE" = "ubsan" ]; then export export CFLAGS='-fsanitize=undefined'; export CXXLAGS='-fsanitize=undefined'; export LDFLAGS='-fsanitize=undefined'; fi install: + - ps -ef - if [[ "$CROSS_COMPILE" == 1 ]] ; then if [[ "$ARM_ARCH_DIR" == "aarch64-linux-gnu" ]] ; then mkdir $HOME/linker_bin ; @@ -45,7 +74,12 @@ install: - ./bootstrap - mkdir build - cd build - - if [ "$LINKING" = "static" ]; then + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then + ../configure --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --disable-fastopen --disable-examples CPPFLAGS='-I/c/tools/msys64/mingw64/include/ -I/usr/include/' LDFLAGS='-L/c/tools/msys64/mingw64/lib -L/usr/lib/' ; + cd .. ; + find . -name Makefile -type f -exec sed -i "s/\$(SHELL)/\/usr\/bin\/sh.exe/" "{}" + ; + cd build ; + elif [ "$LINKING" = "static" ]; then ../configure --enable-static --disable-fastopen; elif [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then ../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen; @@ -63,8 +97,9 @@ install: - if [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "aarch64-linux-gnu" ]; then sed -i 's+/usr/bin/ld+$HOME/linker_bin/ld+g' libtool; fi - if [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "aarch64-linux-gnu" ]; then sed -i 's+/usr/bin/ld+$HOME/linker_bin/ld+g' Makefile; fi - make - - make check TESTS= + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then make check TESTS= ; fi script: + - ps -ef - if [[ "$CROSS_COMPILE" == 1 ]]; then cd test ; if [[ "$ARM_ARCH_DIR" == "aarch64-linux-gnu" ]]; then @@ -85,12 +120,10 @@ script: qemu-arm -L /usr/arm-linux-gnueabi/ ./.libs/threaded ; fi fi - - make check - - cat test/test-suite.log + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then make check ; fi + - if [ "$TRAVIS_OS_NAME" != "windows" ]; then cat test/test-suite.log; fi - if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; fi; - if [ "$VALGRIND" = "valgrind" ]; then cat test/test-suite-memcheck.log; fi; - - ls -l /usr/local/lib/ - - ls -l /usr/lib/ - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; fi - | if [ "$PERFORMANCE" = "select" ]; then @@ -110,15 +143,23 @@ script: ./benchmark_threads 8080 & sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext fi +after_script: + - ps -ef + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then ps -Wla | sort ; fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then gpgconf --kill gpg-agent ; fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then taskkill //F //PID $(ps -Wla | tr -s ' ' | grep gpg | cut -f2 -d' ') ; fi + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then ps -Wla | sort ; fi + - echo $$ after_success: - if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then bash <(curl -s https://codecov.io/bash); fi matrix: exclude: - compiler: clang env: DEBUG="debug" COVERAGE="coverage" - - compiler: clang - env: LINKING='static' + - os: windows include: + - os: windows + env: DEBUG="nodebug" COVERAGE="nocoverage" YARN_GPG=no - os: linux addons: apt: