#! /bin/sh # -*- Mode: Shell-script -*- # ---------------------------------------------------------------------- # guile.test --- test guile-main program attribute # make sure that when it is not specified # then option processing consumes all args. # # Time-stamp: "2007-07-04 10:12:10 bkorb" # Author: Bruce Korb ## ## This file is part of AutoOpts, a companion to AutoGen. ## AutoOpts is free software. ## AutoOpts is copyright (c) 1992-2007 by Bruce Korb - all rights reserved ## ## AutoOpts is available under any one of two licenses. The license ## in use must be one of these two and the choice is under the control ## of the user of the license. ## ## The GNU Lesser General Public License, version 3 or later ## See the files "COPYING.lgplv3" and "COPYING.gplv3" ## ## The Modified Berkeley Software Distribution License ## See the file "COPYING.mbsd" ## ## These files have the following md5sums: ## ## 239588c55c22c60ffe159946a760a33e pkg/libopts/COPYING.gplv3 ## fa82ca978890795162346e661b47161a pkg/libopts/COPYING.lgplv3 ## 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd # # $Id: guile.test,v 4.8 2007/07/04 21:36:39 bkorb Exp $ # ---------------------------------------------------------------------- . ./defs # # # # # # # # # # DEFINITIONS FILE # # # # # # # # # echo "creating ${testname}.def in `pwd`" testname="${testname}" \ argument='[ ...]' \ long_opts="true" \ ${SHELLX} ${stdopts} option second: || failure "Could not run stdopts.def" sed -e '/name = "second"/a\ max = NOLIMIT; stack_arg;' \ -e '/name = "option/a\ enabled;' ${testname}.def > ${testname}.tmp mv -f ${testname}.tmp ${testname}.def cat >> ${testname}.def <<_EOF_ include = '#include '; include = '#include '; include = '#include '; guile-main; before-guile-boot = ' fputs( "guile starts\n", stdout );'; _EOF_ echo ${AG_L} ${testname}.def ${AG_L} ${testname}.def || \ failure AutoGen could not process LIB="${LIB} `guile-config link`" compile "-?" # # # # # # # # # # HELP OUTPUT FILE # # # # # # # # # echo creating ${testname}.hlp cat > ${testname}.hlp <<'_EOF_' guile starts test_guile - Test AutoOpts for guile USAGE: guile [ - [] | --[{=| }] ]... \ [ ...] Flg Arg Option-Name Description -o no option The option option descrip - enabled by default -s Str second The second option descrip - may appear multiple times -? no help Display usage information and exit -! no more-help Extended usage information passed thru pager Options are specified by doubled hyphens and their name or by a single hyphen and the flag character. _EOF_ cmp -s ${testname}.h*lp || \ failure "`diff ${testname}.hlp ${testname}.help`" f=`(./${testname} -- -v 2>&1) | ${GREP} 'GNU General Public Licence'` test -n "$f" || \ failure version does not show GPL cat > ${testname}.runbase <<'_EOF_' guile> #t guile> #t guile> 2 guile> ("value 1 for second." "value number two") guile> #f guile> #t _EOF_ ./${testname} -s 'value 1 for second.' -s 'value number two' \ > ${testname}.tmprun <<'_EOF_' have-opt-second opt-enabled-second opt-ct-second opt-args-second have-opt-option opt-enabled-option _EOF_ test $? -ne 0 && failure guile script failed # Delete the last line. It may not have a new line and that # causes a compare failure (despite the `-b') on some systems # sed '$d' ${testname}.tmprun > ${testname}.runout diff -b ${testname}.run* > /dev/null || \ failure unanticipated run output cleanup ## Local Variables: ## Mode: shell-script ## indent-tabs-mode: nil ## sh-indentation: 2 ## End: # end of guile.test