File: travis-check.sh

package info (click to toggle)
universal-ctags 0%2Bgit20200824-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 22,092 kB
  • sloc: ansic: 103,112; lisp: 7,241; sh: 6,962; vhdl: 5,924; perl: 2,014; cpp: 1,928; python: 1,828; javascript: 1,529; cs: 1,193; sql: 587; php: 544; f90: 534; makefile: 500; ruby: 498; yacc: 459; asm: 358; fortran: 341; xml: 308; objc: 289; ada: 273; tcl: 205; java: 157; cobol: 122; erlang: 61; ml: 49; awk: 43
file content (91 lines) | stat: -rwxr-xr-x 2,780 bytes parent folder | download
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
#!/bin/sh -e
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program 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 General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.

make --version

# Our sandbox doesn't work with gcov.
# Following cases target ctags without gcov.
SANDBOX_CASES=sandbox,sandbox-crash,sandbox-default-req,sandbox-unknown-submode


if [ "$TARGET" = "Unix" ]; then
    ./autogen.sh
    CONFIGURE_CMDLINE="../configure --enable-debugging --enable-iconv "

    BUILDDIR0="$TRAVIS_OS_NAME"-"$CC"
    if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CC" = "gcc" ]; then
		if ! git diff --exit-code optlib; then
			echo "Files under optlib are not up to date."
			echo "If you change optlib/foo.ctags, don't forget to add optlib/foo.c to your commit."
			exit 1
		fi

        BUILDDIR=${BUILDDIR0}-gcov
        mkdir -p "${BUILDDIR}"
        (
            cd "${BUILDDIR}"
            ${CONFIGURE_CMDLINE} --enable-coverage-gcov
            make -j2
            echo 'List features'
            ./ctags --list-features
            echo 'Run "make check" with gcov'
            make check roundtrip TRAVIS=1
			make dist
			tar zxvf universal-ctags*tar.gz
			(
				cd universal-ctags*[0-9]
				BUILDDIR=${BUILDDIR0}
				mkdir -p "${BUILDDIR}"
				(
					cd "${BUILDDIR}"
					${CONFIGURE_CMDLINE}
					make -j2
					echo 'Run "make tmain (sandbox only)" without gcov'
					make tmain TRAVIS=1 UNITS=${SANDBOX_CASES}

					make clean
				)
			)
        )

    else
		make -B -C man QUICK=1 update-docs
		if ! git diff --exit-code docs/man; then
			echo "Files under docs/man/ are not up to date."
			echo "Please execute 'make -C man QUICK=1 update-docs' and commit them."
			exit 1
		fi

        BUILDDIR=${BUILDDIR0}
        mkdir -p "${BUILDDIR}"
        (
            cd "${BUILDDIR}"
            ${CONFIGURE_CMDLINE}
            make -j2
            echo 'List features'
            ./ctags --list-features
            echo 'Run "make check" (without gcov)'
            make check roundtrip TRAVIS=1
        )
    fi

elif [ "$TARGET" = "Mingw32" ]; then
    # Don't run test units in Mingw32 target.
    make -j2 CC=i686-w64-mingw32-gcc WINDRES=i686-w64-mingw32-windres CC_FOR_PACKCC=gcc -f mk_mingw.mak

else
    echo "Invalid TARGET value: $TARGET" 1>&2
    exit 1
fi