Skip to content
96 changes: 88 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ language: c++
# TODO(2019-07-21): Add "ffmpeg=1" if FFmpeg 4.x becomes available in Ubuntu
env:
global:
- COMMON_FLAGS="-j4 test=1 mad=1 faad=1 opus=1 modplug=1 wv=1 hss1394=0 virtualize=0 debug_assertions_fatal=1 verbose=0"
# For SCons builds
- SCONSFLAGS="test=1 mad=1 faad=1 opus=1 modplug=1 wv=1 hss1394=0 virtualize=0 debug_assertions_fatal=1 verbose=0"
Comment thread
Holzhaus marked this conversation as resolved.
# For CMake builds
- CMAKEFLAGS="-DMAD=ON -DFAAD=ON -DOPUS=ON -DMODPLUG=ON -DWAVPACK=ON -DHSS1394=OFF"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAAD2 should be disabled for macOS builds, both for SCons and CMake. I see errors to load the corresponding dynamic library at runtime during the tests. We could move the corresponding options into the platform-dependent EXTRA flags.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we install faad2 via homebrew, strange.

- GTEST_COLOR=1
- CTEST_OUTPUT_ON_FAILURE=1

jobs:
include:
Expand All @@ -27,23 +32,51 @@ jobs:
- python3-setuptools
- python3-wheel

- name: Ubuntu/gcc build
- name: Ubuntu/gcc/SCons build
os: linux
dist: xenial
compiler: gcc
# Ubuntu Xenial build prerequisites
env: EXTRA_FLAGS="localecompare=1"
before_install:
- sudo apt-get install -y scons
install:
- scons $COMMON_FLAGS $EXTRA_FLAGS
- scons -j "$(nproc)" localecompare=1
script:
# NOTE(sblaisot): 2018-01-02 removing gdb wrapper on linux due to a bug in
# return code in order to avoid having a successful build when a test fail.
# https://bugs.launchpad.net/mixxx/+bug/1699689
- ./mixxx-test

- name: OSX/clang build
- name: Ubuntu/gcc/CMake build
os: linux
dist: xenial
compiler: gcc
cache: ccache
# Ubuntu Xenial build prerequisites
env: CMAKEFLAGS_EXTRA="-DLOCALECOMPARE=ON"
before_install:
- sudo apt-get install -y cmake
- export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
- cmake --version
- ccache -s
install:
- mkdir cmake_build
- cd cmake_build
- cmake -L $CMAKEFLAGS $CMAKEFLAGS_EXTRA ..
- cmake --build .
- sudo cmake --build . --target install
script:
# Run tests and benchmarks
- cmake --build . --target test
- cmake --build . --target benchmark

- name: OSX/clang/SCons build
os: osx
compiler: clang
cache:
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
# Workaround for bug in libopus's opus.h including <opus_multistream.h>
# instead of <opus/opus_multistream.h>.
# Virtual X (Xvfb) is needed for analyzer waveform tests
Expand All @@ -52,14 +85,63 @@ jobs:
CXXFLAGS="-isystem /usr/local/include/opus"
DISPLAY=:99.0
before_install:
- brew install scons
- export QTDIR="$(find /usr/local/Cellar/qt -d 1 | tail -n 1)"
- echo "QTDIR=$QTDIR"
install:
- scons $COMMON_FLAGS $EXTRA_FLAGS
# We are hardcoding 4 threads here since "$(sysctl -n hw.ncpu)" only
# returns 2 and makes the travis job run into a timeout:
# https://docs.travis-ci.com/user/reference/overview/#virtualization-environments
- scons -j4
script:
# lldb doesn't provide an easy way to exit 1 on error:
# https://bugs.llvm.org/show_bug.cgi?id=27326
- lldb ./mixxx-test --batch -o run -o quit -k 'thread backtrace all' -k "script import os; os._exit(1)"
before_cache:
# Avoid indefinite cache growth
- brew cleanup
# Cache only .git files under "/usr/local/Homebrew" so "brew update"
# does not take 5min every build
# Source: https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/12
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete

- name: OSX/clang/CMake build
os: osx
compiler: clang
cache:
ccache: true
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
# Workaround for bug in libopus's opus.h including <opus_multistream.h>
# instead of <opus/opus_multistream.h>.
# Virtual X (Xvfb) is needed for analyzer waveform tests
env: >-
CMAKEFLAGS_EXTRA="-DLOCALECOMPARE=OFF -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5/"
DISPLAY=:99.0
CMAKE_BUILD_PARALLEL_LEVEL=4
before_install:
- brew install ccache
- export PATH="/usr/local/opt/ccache/bin:$PATH"
- cmake --version
- ccache -s
install:
- mkdir cmake_build
- cd cmake_build
- cmake -L $CMAKEFLAGS $CMAKEFLAGS_EXTRA ..
- cmake --build .
- sudo cmake --build . --target install
script:
# Run tests and benchmarks
- cmake --build . --target test
- cmake --build . --target benchmark
before_cache:
# Avoid indefinite cache growth
- brew cleanup
# Cache only .git files under "/usr/local/Homebrew" so "brew update"
# does not take 5min every build
# Source: https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/12
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete

git:
depth: 1
Expand Down Expand Up @@ -105,7 +187,6 @@ addons:
- qt5-default
- qtscript5-dev
- qt5keychain-dev
- scons
homebrew:
update: true
packages:
Expand All @@ -129,7 +210,6 @@ addons:
- protobuf
- qt5
- rubberband
- scons
- sound-touch
- taglib
- wavpack
Expand Down
5 changes: 4 additions & 1 deletion src/test/globaltrackcache_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ TEST_F(GlobalTrackCacheTest, concurrentDelete) {
// lp1744550: A decent number of iterations is needed to reliably
// reveal potential race conditions while evicting tracks from
// the cache!
for (int i = 0; i < 250000; ++i) {
// NOTE(2019-12-14, uklotzde): On Travis and macOS executing 10_000
// iterations takes ~1 sec. In order to safely finish this test within
// the timeout limit of 30 sec. we use 20 * 10_000 = 200_000 iterations.
for (int i = 0; i < 200000; ++i) {
m_recentTrackPtr.reset();

TrackId trackId;
Expand Down