]> granicus.if.org Git - check/blob - travis.sh
configure: optional build documentation, travis
[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 . || exit 1
34    make || exit 1
35    ctest -V || exit 1
36    sudo make install || exit 1
37 fi
38
39 if [ "${USE_CMAKE}" = 'NO' ] ; then
40    autoreconf -i || exit 1
41    ./configure ${EXTRA_ARGS} --disable-build-docs || exit 1
42    make || exit 1
43
44    if [ -f doc/version.texi ]; then
45       echo "Documentation was generated (doc/version.texi), though disabled";
46       exit 1;
47    fi
48
49    make check || exit 1
50    sudo make install || exit 1
51
52    make doc/check_html || exit 1
53    if [ ! -d doc/check_html ]; then
54       echo "HTML documentation not generated"
55       exit 1;
56    fi
57
58    make doc/doxygen || exit 1
59    if [ ! -d doc/doxygen ]; then
60       echo "Doxygen documentation not generated";
61       exit 1;
62    fi
63
64    pushd doc/example
65    autoreconf -i || exit 1
66    ./configure || exit 1
67    make || exit 1
68    export LD_LIBRARY_PATH=/usr/local/lib
69    make check
70    test_result=$?
71    cat tests/test-suite.log
72    cat tests/check_money.trs
73    if [ $test_result -ne 0 ]; then
74       exit 1
75    fi
76    popd
77 fi
78
79 if [ "${PRE_RELEASE_CHECK}" = 'YES' ]; then
80    autoreconf --install || exit 1
81    ./configure || exit 1
82    make prereleasecheck || exit 1
83    tar xf check-*.tar.gz
84    cd check-*
85    cmake . || exit 1
86    make || exit 1
87 fi
88
89 if [ "${SCAN_BUILD}" = 'YES' ]; then
90    autoreconf --install || exit 1
91    scan-build ./configure --enable-snprintf-replacement --enable-timer-replacement || exit 1
92    scan-build -o clang make || exit 1
93    if [ -n "$(find clang -type f)" ]; then
94       echo "scan-build found potential issues"
95       find clang -type f -print -exec cat \{} \;
96       exit 1
97    fi
98 fi
99