forked from libcheck/check
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
99 lines (86 loc) · 2.54 KB
/
travis.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
90
91
92
93
94
95
96
97
98
#!/bin/bash
# Copyright (C) 2016 Branden Archer <[email protected]>
# Copyright (C) 2016 Joshua D. Boyd <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
set -x
if [ -d doc/check_html ]; then
echo "The HTML output folder already exists";
exit 1;
fi
if [ -d doc/doxygen ]; then
echo "The doxygen output folder already exists";
exit 1;
fi
if [ "${USE_CMAKE}" = 'YES' ] ; then
cmake . || exit 1
make || exit 1
ctest -V || exit 1
sudo make install || exit 1
fi
if [ "${USE_CMAKE}" = 'NO' ] ; then
autoreconf -i || exit 1
./configure ${EXTRA_ARGS} || exit 1
make || exit 1
if [ ! -f doc/version.texi ]; then
echo "version.texi not generated";
exit 1;
fi
make check || exit 1
sudo make install || exit 1
make doc/check_html || exit 1
if [ ! -d doc/check_html ]; then
echo "HTML documentation not generated"
exit 1;
fi
make doc/doxygen || exit 1
if [ ! -d doc/doxygen ]; then
echo "Doxygen documentation not generated";
exit 1;
fi
pushd doc/example
autoreconf -i || exit 1
./configure || exit 1
make || exit 1
export LD_LIBRARY_PATH=/usr/local/lib
make check
test_result=$?
cat tests/test-suite.log
cat tests/check_money.trs
if [ $test_result -ne 0 ]; then
exit 1
fi
popd
fi
if [ "${PRE_RELEASE_CHECK}" = 'YES' ]; then
autoreconf --install || exit 1
./configure || exit 1
make prereleasecheck || exit 1
tar xf check-*.tar.gz
cd check-*
cmake . || exit 1
make || exit 1
fi
if [ "${SCAN_BUILD}" = 'YES' ]; then
autoreconf --install || exit 1
scan-build ./configure --enable-snprintf-replacement --enable-timer-replacement || exit 1
scan-build -o clang make || exit 1
if [ -n "$(find clang -type f)" ]; then
echo "scan-build found potential issues"
find clang -type f -print -exec cat \{} \;
exit 1
fi
fi