source: trunk/test/yat_revision_header_test.sh @ 2552

Last change on this file since 2552 was 2552, checked in by Peter, 10 years ago

YAT_REVISION_HEADER: avoid updating time-stamp of file.h.in if not needed. closes #659

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