forked from openscad/openscad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-ci.sh
executable file
·89 lines (75 loc) · 2.36 KB
/
travis-ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
83
84
85
86
87
88
89
#!/bin/bash
set -e
travis_nanoseconds() {
python -c 'import time; print("{:d}".format(int(time.time()*1000000000)))'
}
travis_start() {
travis_timer_id=`printf %08x $(( RANDOM * RANDOM ))`
travis_start_time=`travis_nanoseconds`
echo -e "travis_time:start:$travis_timer_id\r\033[0m$2"
echo -e "travis_fold:start:$1\n$2"
}
travis_finish() {
echo "travis_fold:end:$1"
travis_end_time=`travis_nanoseconds`
local duration=$(( $travis_end_time - $travis_start_time ))
echo -en "\ntravis_time:end:$travis_timer_id:start=$travis_start_time,finish=$travis_end_time,duration=$duration\r\033[0m"
}
PARALLEL=-j2
# This should be set via .travis.yml depending on the OS/Distribution
# PARALLEL_CTEST=-j1
travis_start qmake "Building OpenSCAD using qmake"
qmake CONFIG+=experimental CONFIG+=nogui && make $PARALLEL
travis_finish qmake
travis_start cmake "Building tests using cmake"
cd tests
cmake .
if [[ $? != 0 ]]; then
echo "Error configuring test suite"
exit 1
fi
make $PARALLEL
if [[ $? != 0 ]]; then
echo "Error building test suite"
exit 1
fi
travis_finish cmake
travis_start ctest "Running tests using ctest"
# Exclude tests known the cause issues on Travis
# opencsgtest_rotate_extrude-tests - Fails on Ubuntu 12.04 using Gallium 0.4 drivers
# *_text-font-direction-tests - Fails due to old freetype (issue #899)
# throwntogethertest_issue964 - Fails due to non-planar quad being tessellated slightly different
# opencsgtest_issue1165 - z buffer tearing
# Fails on Apple's software renderer:
# opencsgtest_issue1258
# throwntogethertest_issue1089
# throwntogethertest_issue1215
ctest $PARALLEL_CTEST -E "\
opencsgtest_rotate_extrude-tests|\
opencsgtest_render-tests|\
opencsgtest_rotate_extrude-hole|\
opencsgtest_internal-cavity|\
opencsgtest_internal-cavity-polyhedron|\
opencsgtest_minkowski3-erosion|\
opencsgtest_issue835|\
opencsgtest_issue911|\
opencsgtest_issue913|\
opencsgtest_issue1215|\
opencsgtest_issue1105d|\
dxfpngtest_text-font-direction-tests|\
cgalpngtest_text-font-direction-tests|\
opencsgtest_text-font-direction-tests|\
csgpngtest_text-font-direction-tests|\
svgpngtest_text-font-direction-tests|\
throwntogethertest_text-font-direction-tests|\
throwntogethertest_issue964|\
opencsgtest_issue1165|\
opencsgtest_issue1258|\
throwntogethertest_issue1089|\
throwntogethertest_issue1215\
"
if [[ $? != 0 ]]; then
echo "Test failure"
exit 1
fi
travis_finish ctest