You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

233 lines
7.4 KiB

  1. language: c
  2. sudo: required
  3. addons:
  4. apt:
  5. sources:
  6. - ubuntu-toolchain-r-test
  7. - llvm-toolchain-precise-3.7
  8. packages:
  9. - cmake
  10. - gcc-4.8
  11. - lcov
  12. - clang-3.7
  13. - valgrind
  14. - libev-dev
  15. - libc-ares-dev
  16. - g++-4.8
  17. - libstdc++-4.8-dev
  18. - stunnel4
  19. - libidn2-0-dev
  20. - libssh2-1-dev
  21. - libssh-dev
  22. - krb5-user
  23. matrix:
  24. include:
  25. - os: linux
  26. compiler: gcc
  27. dist: trusty
  28. env: T=normal C="--with-gssapi"
  29. - os: linux
  30. compiler: gcc
  31. dist: trusty
  32. env: T=normal C=--with-libssh
  33. - os: linux
  34. compiler: gcc
  35. dist: trusty
  36. env: T=normal C="--disable-http --disable-smtp --disable-imap"
  37. - os: linux
  38. compiler: gcc
  39. dist: trusty
  40. env: T=normal C="--enable-ares"
  41. - os: linux
  42. compiler: gcc
  43. dist: trusty
  44. env: T=normal BROTLI=yes
  45. - os: linux
  46. compiler: gcc
  47. dist: trusty
  48. env: T=novalgrind BORINGSSL=yes -C="--with-ssl=$HOME/boringssl" LD_LIBRARY_PATH=/home/travis/boringssl/lib
  49. - os: linux
  50. compiler: clang
  51. dist: trusty
  52. env: T=debug
  53. - os: osx
  54. compiler: gcc
  55. env: T=debug
  56. - os: osx
  57. compiler: gcc
  58. env: T=debug C=--enable-ares
  59. - os: osx
  60. compiler: gcc
  61. env: T=debug C="--with-ssl=/usr/local/opt/openssl --with-libmetalink"
  62. - os: osx
  63. compiler: gcc
  64. env: T=debug C="--with-ssl=/usr/local/opt/libressl --with-libmetalink"
  65. - os: osx
  66. compiler: clang
  67. env: T=debug C="--without-ssl --with-darwinssl --with-libmetalink"
  68. - os: osx
  69. compiler: clang
  70. env: T=normal
  71. - os: linux
  72. compiler: gcc
  73. dist: trusty
  74. env: T=cmake
  75. - os: linux
  76. compiler: clang
  77. dist: trusty
  78. env: T=cmake
  79. - os: linux
  80. compiler: gcc
  81. dist: precise
  82. env: T=coverage
  83. - os: linux
  84. compiler: gcc
  85. dist: trusty
  86. env: T=distcheck
  87. - os: linux
  88. compiler: clang
  89. dist: trusty
  90. env: T=fuzzer
  91. install:
  92. - if [ "$T" = "coverage" ]; then pip2 install --user cpp-coveralls; fi
  93. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update > /dev/null; fi
  94. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew reinstall libtool > /dev/null; fi
  95. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install rtmpdump libssh2 c-ares libmetalink libressl nghttp2 libmetalink; fi
  96. - if [ $TRAVIS_OS_NAME = linux ]; then
  97. curl -L https://github.com/nghttp2/nghttp2/releases/download/v1.24.0/nghttp2-1.24.0.tar.gz |
  98. tar xzf - &&
  99. (cd nghttp2-1.24.0 && CXX="g++-4.8" ./configure --prefix=/usr --disable-threads --enable-app && make && sudo make install);
  100. fi
  101. before_script:
  102. - ./buildconf
  103. - |
  104. # No brotli package available for Trusty. Download & compile from source.
  105. # Cannot be done in the install script because cmake is needed.
  106. if [ "$TRAVIS_OS_NAME" = linux -a "$BROTLI" ]; then
  107. curl -L https://github.com/google/brotli/archive/v1.0.1.tar.gz |
  108. tar xzf - &&
  109. (
  110. cd brotli-1.0.1 &&
  111. cmake . -DCMAKE_INSTALL_PREFIX=/usr \
  112. -DCMAKE_INSTALL_LIBDIR=/usr/lib &&
  113. make &&
  114. sudo make install
  115. )
  116. fi
  117. if [ "$TRAVIS_OS_NAME" = linux -a "$BORINGSSL" ]; then
  118. (cd $HOME &&
  119. git clone --depth=1 https://boringssl.googlesource.com/boringssl &&
  120. cd boringssl &&
  121. mkdir build &&
  122. cd build &&
  123. cmake -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1 .. &&
  124. make &&
  125. cd .. &&
  126. mkdir lib &&
  127. cd lib &&
  128. ln -s ../build/crypto/libcrypto.so . &&
  129. ln -s ../build/ssl/libssl.so . &&
  130. echo "BoringSSL lib dir: "`pwd` &&
  131. export LIBS=-lpthread )
  132. fi
  133. script:
  134. - |
  135. # Uncomment this when `coverage` runs on Trusty.
  136. # set -eo pipefail
  137. if [ "$T" = "coverage" ]; then
  138. export CC="gcc-4.8"
  139. ./configure --enable-debug --disable-shared --enable-code-coverage
  140. make
  141. make TFLAGS=-n test-nonflaky
  142. tests="1 2 3 4 5 6 7 8 9 10 200 201 202 300 301 302 500 501 502 503 504 506 507 508 509 510 511 512 513 514 515 516 517 518 519 600 601 800 801 802 803 900 901 902 903 1000 1001 1002 1004 1302 1303 1304 1305 1306 1308 1400 1401 1402 1404 1450 1451 1452 1502 1507 1508 1600 1602 1603 1605"
  143. make "TFLAGS=-n -e $tests" test-nonflaky
  144. make "TFLAGS=-n -t $tests" test-nonflaky
  145. coveralls --gcov /usr/bin/gcov-4.8 --gcov-options '\-lp' -i src -e lib -e tests -e docs -b $PWD/src
  146. coveralls --gcov /usr/bin/gcov-4.8 --gcov-options '\-lp' -e src -i lib -e tests -e docs -b $PWD/lib
  147. fi
  148. - |
  149. set -eo pipefail
  150. if [ "$T" = "debug" ]; then
  151. ./configure --enable-debug --enable-werror $C
  152. make && make examples
  153. make TFLAGS=-n test-nonflaky
  154. fi
  155. - |
  156. set -eo pipefail
  157. if [ "$T" = "novalgrind" ]; then
  158. ./configure $C
  159. make && make examples
  160. make TFLAGS=-n test-nonflaky
  161. fi
  162. - |
  163. set -eo pipefail
  164. if [ "$T" = "normal" ]; then
  165. ./configure --enable-warnings --enable-werror $C
  166. make && make examples
  167. make test-nonflaky
  168. fi
  169. - |
  170. set -eo pipefail
  171. if [ "$T" = "cmake" ]; then
  172. mkdir build
  173. cd build
  174. cmake ..
  175. make
  176. fi
  177. - |
  178. set -eo pipefail
  179. if [ "$T" = "distcheck" ]; then
  180. ./configure
  181. make
  182. ./maketgz 99.98.97
  183. # verify in-tree build - and install it
  184. (tar xf curl-99.98.97.tar.gz && \
  185. cd curl-99.98.97 && \
  186. ./configure --prefix=$HOME/temp && \
  187. make && \
  188. make TFLAGS=1 test && \
  189. make install)
  190. # basic check of the installed files
  191. bash scripts/installcheck.sh $HOME/temp
  192. rm -rf curl-99.98.97
  193. # verify out-of-tree build
  194. (tar xf curl-99.98.97.tar.gz && \
  195. mkdir build && \
  196. cd build && \
  197. ../curl-99.98.97/configure && \
  198. make && \
  199. make TFLAGS=1 test)
  200. # verify cmake build
  201. rm -rf curl-99.98.97
  202. (tar xf curl-99.98.97.tar.gz && \
  203. cd curl-99.98.97 && \
  204. mkdir build && \
  205. cd build && \
  206. cmake .. && \
  207. make)
  208. fi
  209. - |
  210. set -eo pipefail
  211. if [ "$T" = "fuzzer" ]; then
  212. # Download the fuzzer to a temporary folder
  213. ./tests/fuzz/download_fuzzer.sh /tmp/curl_fuzzer
  214. export CURLSRC=$PWD
  215. # Run the mainline fuzzer test
  216. pushd /tmp/curl_fuzzer
  217. ./mainline.sh ${CURLSRC}
  218. popd
  219. fi
  220. # whitelist branches to avoid testing feature branches twice (as branch and as pull request)
  221. branches:
  222. only:
  223. - master
  224. notifications:
  225. email: false