ci-linux.sh 1.97 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1
2
#!/bin/bash

Jan Möbius's avatar
Jan Möbius committed
3
4
5
# Script abort on error
set -e

Jan Möbius's avatar
Jan Möbius committed
6
7
8
9
10
11
COMPILER=$1
LANGUAGE=$2
QTVERSION=$3

OPTIONS=""

Jan Möbius's avatar
Jan Möbius committed
12
BUILDPATH=""
13

Jan Möbius's avatar
Jan Möbius committed
14
15
if [ "$COMPILER" == "gcc" ]; then
  echo "Building with GCC";
Jan Möbius's avatar
Jan Möbius committed
16
  BUILDPATH="gcc"
Jan Möbius's avatar
Jan Möbius committed
17
18
19
elif [ "$COMPILER" == "clang" ]; then

  OPTIONS="$OPTIONS -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DGTEST_PREFIX=~/sw/gtest-1.7.0-clang/ "
Jan Möbius's avatar
Jan Möbius committed
20
  BUILDPATH="clang"
Jan Möbius's avatar
Jan Möbius committed
21
22
23
24
25
  echo "Building with CLANG";
fi  

if [ "$LANGUAGE" == "C++98" ]; then
  echo "Building with C++98";
Jan Möbius's avatar
Jan Möbius committed
26
  BUILDPATH="$BUILDPATH-cpp98"
Jan Möbius's avatar
Jan Möbius committed
27
28
29
elif [ "$LANGUAGE" == "C++11" ]; then
  echo "Building with C++11";
  OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
Jan Möbius's avatar
Jan Möbius committed
30
  BUILDPATH="$BUILDPATH-cpp11"
Jan Möbius's avatar
Jan Möbius committed
31
32
33
34
35
fi  

if [ "QTVERSION" == "QT4" ]; then
  echo "Building with QT4";
  OPTIONS="$OPTIONS -DFORCE_QT4=TRUE "
Jan Möbius's avatar
Jan Möbius committed
36
  BUILDPATH="$BUILDPATH-qt4"
Jan Möbius's avatar
Jan Möbius committed
37
elif [ "QTVERSION" == "QT5" ]; then
Jan Möbius's avatar
Jan Möbius committed
38
  echo "Building with QT5";
Jan Möbius's avatar
Jan Möbius committed
39
  BUILDPATH="$BUILDPATH-qt5"
40
  OPTIONS="$OPTIONS -DFORCE_QT4=FALSE -DQWT6_INCLUDE_DIR=~/sw/qwt-6.1/include -DQWT6_LIBRARY_DIR=~/sw/qwt-6.1/lib -DQWT6_LIBRARY=~/sw/qwt-6.1/lib/libqwt.so -DQT5_INSTALL_PATH=/ACG/acgdev/gcc-4.0-x86_64/qt-5.5.0/5.5/gcc_64"
Jan Möbius's avatar
Jan Möbius committed
41
42
fi

Jan Möbius's avatar
Jan Möbius committed
43
echo "Building with path: build-release-$BUILDPATH"
Jan Möbius's avatar
Jan Möbius committed
44

Jan Möbius's avatar
Jan Möbius committed
45

Jan Möbius's avatar
Jan Möbius committed
46
47
48
49
50
51
52
########################################
# Fetch submodules
########################################
git submodule init
git submodule update --remote


Jan Möbius's avatar
Jan Möbius committed
53
54
55
56
57
58
59
60
61
62
63
64
65
########################################
# Fetch test data
########################################
rm -rf TestData
git clone git@roosevelt:moebius/OpenFlipper-Test-Data.git TestData


#########################################
# Build Release version and Unittests
#########################################

# Make release build folder
if [ ! -d build-release ]; then
Jan Möbius's avatar
Jan Möbius committed
66
  mkdir build-release-$BUILDPATH
Jan Möbius's avatar
Jan Möbius committed
67
68
fi

Jan Möbius's avatar
Jan Möbius committed
69
cd build-release-$BUILDPATH
Jan Möbius's avatar
Jan Möbius committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

cmake -DCMAKE_BUILD_TYPE=Release -DOPENFLIPPER_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../

#build it
make

#########################################
# Run Release Unittests
#########################################

# Run tests
cd tests
bash run_tests.sh

cd ..