ci-mac.sh 1.69 KB
Newer Older
1
2
#!/bin/bash

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

Jan Möbius's avatar
Jan Möbius committed
6
7
LANGUAGE=$1

Jan Möbius's avatar
Jan Möbius committed
8
9
PATH=$PATH:/opt/local/bin
export PATH
10

Jan Möbius's avatar
Jan Möbius committed
11
12
13
14
15
16
17
18
19
20
OPTIONS=""

if [ "$LANGUAGE" == "C++98" ]; then
  echo "Building with C++98";
elif [ "$LANGUAGE" == "C++11" ]; then
  echo "Building with C++11";
  OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
fi


21
22
23
24
25
26
27
28
29
30
#########################################
# Build release version
#########################################

if [ ! -d build-release ]; then
  mkdir build-release
fi

cd build-release

Jan Möbius's avatar
Jan Möbius committed
31
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

#build it
make

#build the unit tests
make unittests


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

#execute tests
./unittests --gtest_color=yes --gtest_output=xml

Jan Möbius's avatar
Jan Möbius committed
48
cd ..
Jan Möbius's avatar
Jan Möbius committed
49
50
51
52
53
# Execute Python unittests
cd Python-Unittests

rm -f openmesh.so
cp ../Build/python/openmesh.so .
54
python -m unittest discover -v
Jan Möbius's avatar
Jan Möbius committed
55
56

cd ..
57
58
59
60
61
62
63
64
65
66
67
68
69
cd ..


#########################################
# Build Debug version and Unittests
#########################################

if [ ! -d build-debug ]; then
  mkdir build-debug
fi

cd build-debug

Jan Möbius's avatar
Jan Möbius committed
70
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../
71

Jan Möbius's avatar
Jan Möbius committed
72
73
74
#build it
make

75
76
77
78
79
80
81
82
83
84
85
86
87
#build the unit tests
make unittests


#########################################
# Run Debug Unittests
#########################################

cd Unittests

# Run the unittests
./unittests --gtest_color=yes --gtest_output=xml

Jan Möbius's avatar
Jan Möbius committed
88
89
cd ..

Jan Möbius's avatar
Jan Möbius committed
90
91
# Execute Python unittests
cd Python-Unittests
92

Jan Möbius's avatar
Jan Möbius committed
93
94
rm -f openmesh.so
cp ../Build/python/openmesh.so .
95
python -m unittest discover -v