2539 |
31 Jul 11 |
peter |
#! /bin/sh |
2539 |
31 Jul 11 |
peter |
# $Id$ |
2539 |
31 Jul 11 |
peter |
3 |
# |
3855 |
02 Jan 20 |
peter |
# Copyright (C) 2011, 2012, 2013, 2019 Peter Johansson |
2539 |
31 Jul 11 |
peter |
5 |
# |
2539 |
31 Jul 11 |
peter |
# This file is part of the yat library, http://dev.thep.lu.se/yat |
2539 |
31 Jul 11 |
peter |
7 |
# |
2539 |
31 Jul 11 |
peter |
# The yat library is free software; you can redistribute it |
2539 |
31 Jul 11 |
peter |
# and/or modify it under the terms of the GNU General Public License as |
2539 |
31 Jul 11 |
peter |
# published by the Free Software Foundation; either version 3 of the |
2539 |
31 Jul 11 |
peter |
# License, or (at your option) any later version. |
2539 |
31 Jul 11 |
peter |
12 |
# |
2539 |
31 Jul 11 |
peter |
# The yat library is distributed in the hope that it will be useful, |
2539 |
31 Jul 11 |
peter |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2539 |
31 Jul 11 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2539 |
31 Jul 11 |
peter |
# General Public License for more details. |
2539 |
31 Jul 11 |
peter |
17 |
# |
2539 |
31 Jul 11 |
peter |
# You should have received a copy of the GNU General Public License |
2539 |
31 Jul 11 |
peter |
# along with yat. If not, see <http://www.gnu.org/licenses/>. |
2539 |
31 Jul 11 |
peter |
20 |
|
2539 |
31 Jul 11 |
peter |
21 |
|
2539 |
31 Jul 11 |
peter |
# test macro YAT_REVISION_HEADER |
2539 |
31 Jul 11 |
peter |
23 |
|
2539 |
31 Jul 11 |
peter |
24 |
required="autoconf automake" |
2539 |
31 Jul 11 |
peter |
25 |
|
2539 |
31 Jul 11 |
peter |
26 |
set -e |
2539 |
31 Jul 11 |
peter |
27 |
|
3036 |
03 Jun 13 |
peter |
28 |
. test/init.sh || exit 99 |
2539 |
31 Jul 11 |
peter |
29 |
|
2539 |
31 Jul 11 |
peter |
30 |
cat >> configure.ac <<EOF |
2539 |
31 Jul 11 |
peter |
31 |
AC_PROG_CXX |
2539 |
31 Jul 11 |
peter |
32 |
YAT_REVISION_HEADER([my.am], [my.h], [MY_REVISION], [my.txt]) |
2539 |
31 Jul 11 |
peter |
33 |
AC_CONFIG_FILES([Makefile]) |
2539 |
31 Jul 11 |
peter |
34 |
AC_OUTPUT |
2539 |
31 Jul 11 |
peter |
35 |
EOF |
2539 |
31 Jul 11 |
peter |
36 |
|
2539 |
31 Jul 11 |
peter |
37 |
cat >> Makefile.am <<EOF |
2539 |
31 Jul 11 |
peter |
38 |
BUILT_SOURCES = |
2539 |
31 Jul 11 |
peter |
39 |
DISTCLEANFILES = |
2539 |
31 Jul 11 |
peter |
40 |
EXTRA_DIST = |
2539 |
31 Jul 11 |
peter |
41 |
include my.am |
2539 |
31 Jul 11 |
peter |
42 |
EOF |
2539 |
31 Jul 11 |
peter |
43 |
|
2539 |
31 Jul 11 |
peter |
44 |
cat > hello.cc <<EOF |
2539 |
31 Jul 11 |
peter |
#include <my.h> |
2539 |
31 Jul 11 |
peter |
#include <iostream> |
2539 |
31 Jul 11 |
peter |
#include <string> |
2539 |
31 Jul 11 |
peter |
48 |
int main() |
2539 |
31 Jul 11 |
peter |
49 |
{ |
2539 |
31 Jul 11 |
peter |
50 |
std::cout << MY_REVISION << "\n"; |
2539 |
31 Jul 11 |
peter |
51 |
return 0; |
2539 |
31 Jul 11 |
peter |
52 |
} |
2539 |
31 Jul 11 |
peter |
53 |
EOF |
2539 |
31 Jul 11 |
peter |
54 |
|
2539 |
31 Jul 11 |
peter |
55 |
printf 'r2005' > my.txt |
2539 |
31 Jul 11 |
peter |
56 |
|
2539 |
31 Jul 11 |
peter |
57 |
rm -f my.am |
2539 |
31 Jul 11 |
peter |
58 |
bootstrap |
2539 |
31 Jul 11 |
peter |
59 |
test -r my.am || exit_fail |
2539 |
31 Jul 11 |
peter |
60 |
test -r my.h.in || exit_fail |
2539 |
31 Jul 11 |
peter |
61 |
grep MY_REVISION my.h.in || exit_fail |
2539 |
31 Jul 11 |
peter |
62 |
|
2539 |
31 Jul 11 |
peter |
63 |
grep '\.revision' my.am && exit_fail |
2539 |
31 Jul 11 |
peter |
64 |
|
3825 |
18 Jul 19 |
peter |
65 |
./configure "$my_FLAGS" $configure_opts || exit_fail |
2539 |
31 Jul 11 |
peter |
66 |
make check VERBOSE=1 || exit_fail |
2539 |
31 Jul 11 |
peter |
67 |
|
2552 |
14 Aug 11 |
peter |
68 |
ls -lrt |
2552 |
14 Aug 11 |
peter |
69 |
bootstrap |
2552 |
14 Aug 11 |
peter |
70 |
ls -lrt |
2552 |
14 Aug 11 |
peter |
71 |
find . -anewer my.h.in | grep 'my.h' || exit_fail |
2552 |
14 Aug 11 |
peter |
72 |
|
2539 |
31 Jul 11 |
peter |
73 |
exit_success; |