2 # Copyright (C) 2009, 2010 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Test cscope functionality.
24 cat >> configure.in << 'END'
25 AC_CONFIG_FILES([sub/Makefile])
36 cat >Makefile.am <<'END'
39 foo_SOURCES = foo.c bar.cpp baz.f90
44 cat >sub/Makefile.am <<'END'
46 bar_SOURCES = subsub/dist.c
47 nodist_bar_SOURCES = subsub/gen.c
50 echo 'int generated_subsub () { return 0; }' > $@
51 CLEANFILES = subsub/gen.c
54 echo 'int foo_func () { return 0; }' > foo.c
55 echo 'int main () { return 0; }' > bar.cpp
61 echo 'int main () { return 0; }' > sub/subsub/dist.c
65 $AUTOMAKE --add-missing
69 ../configure || Exit 77
74 ( $CSCOPE --version ) >/dev/null 2>&1 || Exit 77
76 $MAKE cscope 2>stderr || { cat stderr >&2; Exit 1; }
78 grep 'cannot find file' stderr && Exit 1
81 $FGREP foo.c cscope.files
82 $FGREP bar.cpp cscope.files
83 $FGREP sub/subsub/dist.c cscope.files
84 $FGREP sub/subsub/gen.c cscope.files
86 cp cscope.files cscope.files1
88 diff cscope.files cscope.files1
91 test ! -f cscope.files
93 test ! -f cscope.in.out
94 test ! -f cscope.po.out
97 `pwd`/../configure || Exit 77
99 $MAKE cscope 2>stderr || { cat stderr >&2; Exit 1; }
101 grep 'cannot find file' stderr && Exit 1