Skip to content
Snippets Groups Projects
script-linux.sh 743 B
Newer Older
  • Learn to ignore specific revisions
  • 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_COMPILER=$COMPILER -DCMAKE_CXX_FLAGS=--coverage -DCMAKE_C_FLAGS=--coverage ..
    
    hluk's avatar
    hluk committed
    else
    
        qmake CONFIG+=debug QMAKE_CXX=$COMPILER QMAKE_CXXFLAGS="-std=c++11" ..
    
    hluk's avatar
    hluk committed
    fi
    
    # Build.
    make
    
    
    # Test command line arguments that don't need GUI.
    DISPLAY="" ./copyq --help
    DISPLAY="" ./copyq --version
    
    hluk's avatar
    hluk committed
    DISPLAY="" ./copyq --info
    
    # 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
    ./copyq tests -silent
    
    
    cd "$root"