#! /bin/sh # -*- Mode: Shell-script -*- # ---------------------------------------------------------------------- # convert.test --- test XML -> AutoGen conversion # ## Time-stamp: "2007-07-04 11:59:00 bkorb" ## Author: Bruce Korb ## ## This file is part of AutoGen. ## AutoGen copyright (c) 1992-2007 Bruce Korb - all rights reserved ## ## AutoGen 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 3 of the License, or ## (at your option) any later version. ## ## AutoGen 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 . # # $Id: convert.test,v 4.6 2007/07/04 20:51:20 bkorb Exp $ # ---------------------------------------------------------------------- # Common definitions case "X${VERBOSE}" in X | X[nNfF]* ) VERBOSE=false ;; * ) set -x ; VERBOSE=true ;; esac # A standard failure function failure() { cd ${testsubdir} test -d ../FAILURES || mkdir ../FAILURES l=`echo *` ( \cd ../FAILURES ; rm -f $l ) mv -f * ../FAILURES echo "$*" exit 1 } srcdir=`pwd` testname=convert [ -d testdir ] || mkdir testdir cd testdir testsubdir=`pwd` ${X2Aexe} -O ${testname}.out <<'_EndOfXML_' <stumble around the 'XML'.> mumble-1 mumble-2 grumble & "grumble" & grumble. mumble, mumble _EndOfXML_ cat > ${testname}.samp <<'_EndOfSample_' /* Parsed from stdin */ AutoGen Definitions sample.tpl; XML-version = '1.0'; XML-standalone = true; template = 'sample.tpl'; mumble = { content = ''; attr = 'foo'; grumble = { content = ''; text = ''; }; text = 'mumble-1'; /* This is just a /* multi-line comment * / */ text = 'mumble-2'; grumble = { content = ''; text = 'grumble & "grumble" & grumble.'; }; text = 'mumble, mumble'; }; stumble = { content = ''; upon = 'rough going'; }; _EndOfSample_ cmp -s ${testname}.samp ${testname}.out || \ failure "`diff ${testname}.samp ${testname}.out`" ${VERBOSE} || { cd ${srcdir} ; rm -rf ${testsubdir} ; }