language: minimal dist: xenial matrix: include: - name: OSX (clang-9) with PCAP os: osx compiler: clang env: PCAP=ON - name: OSX (clang-9) without PCAP os: osx compiler: clang env: PCAP=OFF - name: OSX (xcode10.1 clang-10) with PCAP os: osx osx_image: xcode10.1 env: PCAP=ON - name: OSX (xcode10.1 clang-10) without PCAP os: osx osx_image: xcode10.1 env: PCAP=OFF - name: Linux (gcc-8) with PCAP os: linux addons: apt: update: true sources: - ubuntu-toolchain-r-test packages: g++-8 env: - CXX=g++-8 - CC=gcc-8 - PCAP=ON - name: Linux (gcc-8) without PCAP os: linux addons: apt: update: true sources: - ubuntu-toolchain-r-test packages: g++-8 env: - CXX=g++-8 - CC=gcc-8 - PCAP=OFF - name: Linux (clang) with PCAP os: linux env: - CXX=clang++ - CC=clang - PCAP=ON - name: Linux (clang) without PCAP os: linux env: - CXX=clang++ - CC=clang - PCAP=OFF - name: Windows (VS2017 x64) # Set a supported language, otherwise the Windows worker will not start. language: shell os: windows env: - PLATFORM: x64 - WIRESHARK_BASE_DIR: C:/wireshark-libs - QT5_BASE_DIR: C:/Qt/5.12.0/msvc2017_64 cache: directories: - travis-cache - name: Windows (VS2017 Win32) # Set a supported language, otherwise the Windows worker will not start. language: shell os: windows env: - PLATFORM: Win32 - WIRESHARK_BASE_DIR: C:/wireshark-libs - QT5_BASE_DIR: C:/Qt/5.12.0/msvc2017 cache: directories: - travis-cache before_install: - echo $TRAVIS_OS_NAME # macos - if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./tools/macos-setup-brew.sh; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install softhsm; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then sed s/access_bpf/staff/ packaging/macosx/ChmodBPF/ChmodBPF | sudo bash; fi # linux - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ./tools/debian-setup.sh --install-optional --install-test-deps -q; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y python3-pip; fi # windows - if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-cache-windows.sh restore; fi - if [ "$TRAVIS_OS_NAME" == "windows" ]; then cinst -y --no-progress python3 winflexbison strawberryperl; fi - | if [ "$TRAVIS_OS_NAME" == "windows" ]; then # Ensure Python and the Scripts folder is available in PATH. # refreshenv does not seem to work in bash, so reload it manually. # Entries in the Machine PATH might contain trailing slashes, drop those. # Apply Process paths before Machine to ensure /bin appears before others (otherwise casher will break and stall). export PATH="$(powershell -Command '("Process", "Machine" | % { [Environment]::GetEnvironmentVariable("PATH", $_) -Split ";" -Replace "\\$", "" } | Select -Unique | % { cygpath $_ }) -Join ":"')" echo "PATH=$PATH" # Workaround to avoid using perl from git-bash $PATH which lacks modules such as Pod::Usage export CMAKE_PROGRAM_PATH=C:/Strawberry/perl/bin fi - if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-install-qt-windows.sh; fi # all platforms - pip3 install pytest pytest-xdist before_script: - mkdir build - cd build - if [ "$TRAVIS_OS_NAME" != "windows" ]; then cmake -GNinja -DENABLE_PCAP=${PCAP} ..; fi - if [ "$TRAVIS_OS_NAME" == "windows" ]; then cmake -A $PLATFORM ..; fi script: # Enable parallelism for msbuild too (since CMake 3.12; ninja does not need it) - export CMAKE_BUILD_PARALLEL_LEVEL=0 - if [ "$TRAVIS_OS_NAME" == "windows" ]; then build_filter=../tools/filter-msbuild.py; else build_filter=cat; fi # Invoke ninja (Linux/macOS, --config is ignored) or msbuild (Windows) - cmake --build . --config RelWithDebInfo | $build_filter - cmake --build . --config RelWithDebInfo --target test-programs | $build_filter - if [ "$PCAP" = "OFF" ]; then export PYTEST_ADDOPTS=--skip-missing-programs=dumpcap,rawshark; fi - if [ "$TRAVIS_OS_NAME" == "linux" -a "$PCAP" = "ON" ]; then sudo setcap "CAP_NET_RAW+eip CAP_NET_ADMIN+eip" run/dumpcap; fi - pytest - cd .. before_cache: - if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-cache-windows.sh save; fi after_script: - cd build - if [ -f run/tshark ]; then run/tshark --version; fi - if [ -f run/RelWithDebInfo/tshark.exe ]; then run/RelWithDebInfo/tshark.exe --version; fi - ../test/travis-upload-artifacts.sh