Skip to content
Snippets Groups Projects
build-linux.sh 577 B
Newer Older
hluk's avatar
hluk committed
#!/bin/bash
# Build and run tests with Travis CI.

set -e -x

root=$PWD
mkdir build
cd build

hluk's avatar
hluk committed
# Configure.
if [ "$CC" == "gcc" ]; then
    # GCC build generates coverage.
    cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=--coverage -DCMAKE_C_FLAGS=--coverage ..
hluk's avatar
hluk committed
else
    qmake QMAKE_CXX=clang++ CONFIG+=debug ..
hluk's avatar
hluk committed
fi

# Build.
make

# Start X11 and window manager.
hluk's avatar
hluk committed
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
hluk's avatar
hluk committed
openbox &

# Clean up old configuration.
rm -rf ~/.config/copyq.test

# Run tests.
hluk's avatar
hluk committed
export COPYQ_LOG_LEVEL=NOTE
./copyq tests -silent

cd "$root"