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

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

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
OPTIONS=""

if [ "$LANGUAGE" == "C++98" ]; then
  echo "Building with C++98";
15
  BUILDPATH="$BUILDPATH-cpp98"
Jan Möbius's avatar
Jan Möbius committed
16
17
18
elif [ "$LANGUAGE" == "C++11" ]; then
  echo "Building with C++11";
  OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
19
20
21
  BUILDPATH="$BUILDPATH-cpp11"  
fi  

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

23
24
25
26
27
echo ""
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks enabled"
echo "====================================================================== \n"
Jan Möbius's avatar
Jan Möbius committed
28

29

30
31
if [ ! -d build-release-$BUILDPATH-Vector-Checks ]; then
  mkdir build-release-$BUILDPATH-Vector-Checks
32
33
fi

34
cd build-release-$BUILDPATH-Vector-Checks
35

36
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../
37
38
39
40
41
42
43

#build it
make

#build the unit tests
make unittests

44
45
46
47
48
49
echo ""
echo ""
echo "======================================================================"
echo "Running unittests Release version with vectorchecks enabled"
echo "====================================================================== \n"

50
51
52
53
54
55

cd Unittests

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

Jan Möbius's avatar
Jan Möbius committed
56
cd ..
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
cd ..

echo ""
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks disabled for python tests"
echo "====================================================================== \n"

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

cd build-release-$BUILDPATH

cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../

#build it
make

echo ""
echo ""
echo "======================================================================"
echo "Running Python unittests Release version "
echo "====================================================================== \n"


Jan Möbius's avatar
Jan Möbius committed
83
84
85
86
87
# Execute Python unittests
cd Python-Unittests

rm -f openmesh.so
cp ../Build/python/openmesh.so .
88
python -m unittest discover -v
Jan Möbius's avatar
Jan Möbius committed
89
90

cd ..
91
92
93
94
cd ..



95
96
97
98
99
100
101
102
103
echo ""
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks enabled"
echo "====================================================================== \n"


if [ ! -d build-debug-$BUILDPATH-Vector-Checks ]; then
  mkdir build-debug-$BUILDPATH-Vector-Checks
104
105
fi

106
cd build-debug-$BUILDPATH-Vector-Checks
107

108
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../
109

Jan Möbius's avatar
Jan Möbius committed
110
111
112
#build it
make

113
114
115
#build the unit tests
make unittests

116
117
118
119
120
echo ""
echo ""
echo "======================================================================"
echo "Running unittests Debug version with vectorchecks enabled"
echo "====================================================================== \n"
121
122
123
124


cd Unittests

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

Jan Möbius's avatar
Jan Möbius committed
128
cd ..
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
cd ..

echo ""
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks disabled for python tests"
echo "====================================================================== \n"

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

cd build-debug-$BUILDPATH

cmake -DCMAKE_BUILD_TYPE=DEBUG -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../

#build it
make

echo ""
echo ""
echo "======================================================================"
echo "Running Python unittests Debug version "
echo "====================================================================== \n"

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

Jan Möbius's avatar
Jan Möbius committed
155
156
# Execute Python unittests
cd Python-Unittests
157

Jan Möbius's avatar
Jan Möbius committed
158
159
rm -f openmesh.so
cp ../Build/python/openmesh.so .
160
python -m unittest discover -v