Blame agen5/test/make.test

Packit Service 96b5d3
#! /bin/sh
Packit Service 96b5d3
#  -*- Mode: Shell-script -*-
Packit Service 96b5d3
# make.test --- test makefile script manufacture
Packit Service 96b5d3
#
Packit Service 96b5d3
# Author:            Bruce Korb <bkorb@gnu.org>
Packit Service 96b5d3
##
Packit Service 96b5d3
## This file is part of AutoGen.
Packit Service 96b5d3
## AutoGen Copyright (C) 1992-2016 by Bruce Korb - all rights reserved
Packit Service 96b5d3
##
Packit Service 96b5d3
## AutoGen is free software: you can redistribute it and/or modify it
Packit Service 96b5d3
## under the terms of the GNU General Public License as published by the
Packit Service 96b5d3
## Free Software Foundation, either version 3 of the License, or
Packit Service 96b5d3
## (at your option) any later version.
Packit Service 96b5d3
##
Packit Service 96b5d3
## AutoGen is distributed in the hope that it will be useful, but
Packit Service 96b5d3
## WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 96b5d3
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 96b5d3
## See the GNU General Public License for more details.
Packit Service 96b5d3
##
Packit Service 96b5d3
## You should have received a copy of the GNU General Public License along
Packit Service 96b5d3
## with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 96b5d3
##
Packit Service 96b5d3
#
Packit Service 96b5d3
# ----------------------------------------------------------------------
Packit Service 96b5d3
Packit Service 96b5d3
. ./defs
Packit Service 96b5d3
Packit Service 96b5d3
# # # # # # # # # # TEMPLATE FILE # # # # # # # # #
Packit Service 96b5d3
Packit Service 96b5d3
echo creating ${testname}.tpl
Packit Service 96b5d3
cat > ${testname}.tpl <<'_EOF_'
Packit Service 96b5d3
[= AutoGen5 Template
Packit Service 96b5d3
Packit Service 96b5d3
=]
Packit Service 96b5d3
== This source:
Packit Service 96b5d3
[=
Packit Service 96b5d3
Packit Service 96b5d3
  (out-push-new)
Packit Service 96b5d3
Packit Service 96b5d3
=]
Packit Service 96b5d3
foo=`pwd` && ls -l $foo
Packit Service 96b5d3
bar=$foo continue=command \
Packit Service 96b5d3
make macros: $(MAKE) $* $@ $< $% $?
Packit Service 96b5d3
shell vars:  ${MAKE} $# $F ${?} ${*} $$
Packit Service 96b5d3
[=
Packit Service 96b5d3
(define txt (out-pop #t))
Packit Service 96b5d3
(string-append txt "\n== converts to:\n\n" (makefile-script txt))
Packit Service 96b5d3
=]
Packit Service 96b5d3
_EOF_
Packit Service 96b5d3
Packit Service 96b5d3
# # # # # # # SAMPLE OUTPUT FILE # # # # # #
Packit Service 96b5d3
Packit Service 96b5d3
echo creating ${testname}.out in `pwd`
Packit Service 96b5d3
# this is the output we should expect to see
Packit Service 96b5d3
cat > ${testname}.samp <<'_EOF_'
Packit Service 96b5d3
== This source:
Packit Service 96b5d3
Packit Service 96b5d3
foo=`pwd` && ls -l $foo
Packit Service 96b5d3
bar=$foo continue=command \
Packit Service 96b5d3
make macros: $(MAKE) $* $@ $< $% $?
Packit Service 96b5d3
shell vars:  ${MAKE} $# $F ${?} ${*} $$
Packit Service 96b5d3
Packit Service 96b5d3
== converts to:
Packit Service 96b5d3
Packit Service 96b5d3
	foo=`pwd` && ls -l $$foo ; \
Packit Service 96b5d3
	bar=$$foo continue=command \
Packit Service 96b5d3
	make macros: $(MAKE) $* $@ $< $% $? ; \
Packit Service 96b5d3
	shell vars:  $${MAKE} $$# $$F $${?} $${*} $$$$
Packit Service 96b5d3
_EOF_
Packit Service 96b5d3
Packit Service 96b5d3
# # # # # # # RUN AUTOGEN # # # # # #
Packit Service 96b5d3
Packit Service 96b5d3
run_ag x -T ${testname}.tpl --no-def > ${testname}.test || \
Packit Service 96b5d3
  failure autogen failed
Packit Service 96b5d3
Packit Service 96b5d3
# # # # # # # TEST RESULTS # # # # # #
Packit Service 96b5d3
Packit Service 96b5d3
cmp -s ${testname}.samp ${testname}.test || \
Packit Service 96b5d3
  failure "`diff ${testname}.samp ${testname}.test`"
Packit Service 96b5d3
Packit Service 96b5d3
cleanup
Packit Service 96b5d3
Packit Service 96b5d3
## Local Variables:
Packit Service 96b5d3
## mode: shell-script
Packit Service 96b5d3
## indent-tabs-mode: nil
Packit Service 96b5d3
## sh-indentation: 2
Packit Service 96b5d3
## sh-basic-offset: 2
Packit Service 96b5d3
## End:
Packit Service 96b5d3
Packit Service 96b5d3
# end of make.test