]> granicus.if.org Git - check/blob - travis.sh
Remove unneeded include()
[check] / travis.sh
1 #!/bin/bash
2 # Copyright (C) 2016 Branden Archer <b.m.archer4@gmail.com>
3 # Copyright (C) 2016 Joshua D. Boyd <jdboyd@jdboyd.net>
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the
17 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 # Boston, MA 02111-1307, USA.
19
20 set -x
21
22 if [ -d doc/check_html ]; then
23    echo "The HTML output folder already exists";
24    exit 1;
25 fi
26
27 if [ -d doc/doxygen ]; then
28    echo "The doxygen output folder already exists";
29    exit 1;
30 fi
31
32 if [ "${USE_CMAKE}" = 'YES' ] ; then
33    cmake --version
34    cmake . || exit 1
35    make || exit 1
36    ctest -V || exit 1
37    sudo make install || exit 1
38 fi
39
40 if [ "${USE_CMAKE}" = 'NO' ] ; then
41    autoreconf -i || exit 1
42    ./configure ${EXTRA_ARGS} --disable-build-docs || exit 1
43    make || exit 1
44
45    if [ -f doc/version.texi ]; then
46       echo "Documentation was generated (doc/version.texi), though disabled";
47       exit 1;
48    fi
49
50    make check || exit 1
51    sudo make install || exit 1
52
53    make doc/check_html || exit 1
54    if [ ! -d doc/check_html ]; then
55       echo "HTML documentation not generated"
56       exit 1;
57    fi
58
59    make doc/doxygen || exit 1
60    if [ ! -d doc/doxygen ]; then
61       echo "Doxygen documentation not generated";
62       exit 1;
63    fi
64
65    pushd doc/example
66    autoreconf -i || exit 1
67    ./configure || exit 1
68    make || exit 1
69    export LD_LIBRARY_PATH=/usr/local/lib
70    make check
71    test_result=$?
72    cat tests/test-suite.log
73    cat tests/check_money.trs
74    if [ $test_result -ne 0 ]; then
75       exit 1
76    fi
77    popd
78 fi
79
80 if [ "${PRE_RELEASE_CHECK}" = 'YES' ]; then
81    autoreconf --install || exit 1
82    ./configure || exit 1
83    make prereleasecheck || exit 1
84    tar xf check-*.tar.gz
85    cd check-*
86    cmake --version
87    cmake . || exit 1
88    make || exit 1
89 fi
90
91 if [ "${SCAN_BUILD}" = 'YES' ]; then
92    autoreconf --install || exit 1
93    scan-build ./configure --enable-snprintf-replacement --enable-timer-replacement || exit 1
94    scan-build -o clang make || exit 1
95    if [ -n "$(find clang -type f)" ]; then
96       echo "scan-build found potential issues"
97       find clang -type f -print -exec cat \{} \;
98       exit 1
99    fi
100 fi
101