diff options
Diffstat (limited to 'autoopts/test/vendor.test')
-rwxr-xr-x | autoopts/test/vendor.test | 174 |
1 files changed, 174 insertions, 0 deletions
diff --git a/autoopts/test/vendor.test b/autoopts/test/vendor.test new file mode 100755 index 0000000..a9d0ac8 --- /dev/null +++ b/autoopts/test/vendor.test @@ -0,0 +1,174 @@ +#! /bin/sh +# -*- Mode: shell-script -*- +# ---------------------------------------------------------------------- +# vendor.test --- test the vendor-opt option +# +# Time-stamp: "2012-03-31 13:11:19 bkorb" +# Author: Bruce Korb <bkorb@gnu.org> +## +## This file is part of AutoOpts, a companion to AutoGen. +## AutoOpts is free software. +## AutoOpts is Copyright (c) 1992-2012 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: +## +## 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 +## 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 +## 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd +# +# ---------------------------------------------------------------------- + +. ./defs + +# # # # # # # # # # DEFINITIONS FILE # # # # # # # # # + +{ + sedcmd=' +s/long-opts;/vendor-opt;/ +/#include "autogen.h"/d +/^prog-name/s/=.*/= '${testname}';/ +s/AutoGen/'${testname}'/g +/^include /s/= '${testname}'5 Temp/= AutoGen5 Temp/ +/^config-header/s/=.*/= '${testname}'-config.h;/ +/call-proc *=/d +/#ifndef XML/,/^#endif/ { + /^#else/,/^#endif/d + /^#/d +} +/flag-code =.*_EOCode_/,/_EOCode_;/d +/flag-code *=/d +' + + ${SED} "$sedcmd" ${top_srcdir}/agen5/opts.def + cat <<- _EOF_ + config-header = ${testname}-config.h; + help-value = h; + save-opts-value = S; + load-opts-value = P; + gnu-usage; + main = { main-type = shell-process; }; + include = '#undef DEBUG_ENABLED'; + _EOF_ +} > ${testname}.def + +{ + sed '/^#endif.*_CONFIG_H/d' ${top_builddir}/config.h + sed '1,/#define *COMPAT_H_GUARD/d + /^#endif .* COMPAT_H_GUARD/{ + s/COMPAT_H_GUARD/AUTOGEN_CONFIG_H/ + q + }' ${top_srcdir}/compat/compat.h +} > ./${testname}-config.h + +echo ${AG_L} ${testname}.def +${AG_L} ${testname}.def || \ + failure AutoGen could not process + +sedcmd='' +HOME=${TMPDIR} compile "-h" +${SED} 1d ${testname}.help > ${testname}.$$ +mv -f ${testname}.$$ ${testname}.help + +clean_help > ${testname}.hlp <<_EOF_ +USAGE: ${testname} [ -<flag> [<val>] ]... [ <def-file> ] +The following options select definitions, templates and scheme functions +to use: + -L str Template search directory list + - may appear multiple times + -T str Override template file + - may not be preset + -l str Library template file + - may appear multiple times + -S str Scheme code file to load + -F str Load scheme function library + -m Do not use in-mem streams +The following options modify how output is handled: + -b str Base name for output file(s) + - may not be preset +The following options are often useful while debugging new templates: + -t num Time limit for server shell + - It must be in the range: + 0 to 3600 + --- show-defs This option has been disabled + -C Leave a core dump on a failure exit +These options can be used to control what gets processed in the +definitions files and template files: + -s str Omit the file with this suffix + - prohibits these options: + select-suffix + - may not be preset + - may appear multiple times + -o str specify this output suffix + - may not be preset + - may appear multiple times + -D str name to add to definition list + - may appear multiple times + -U str definition list removal pattern + - an alternate for define +This option is used to automate dependency tracking: + -M [arg] emit make dependency file + - may not be preset + - may appear multiple times +version, usage and configuration options: + -R str Reset an option's state + -v [arg] Output version information and exit + -h Display extended usage information and exit + -! Extended usage information passed thru pager + -u Abbreviated usage to stdout + -S [arg] Save the option state to a config file + -P str Load options from a config file + - disabled as --no-load-opts + - may appear multiple times +The next option supports vendor supported extra options: + -W str vendor supported additional options + These additional options are: + definitions=str Definitions input file + - disabled as --no-definitions + - enabled by default + - may not be preset + shell=str name or path name of shell to use + equate=str characters considered equivalent + source-time set mod times to latest source + - disabled as --no-source-time + writable Allow output files to be writable + - disabled as --not-writable + loop-limit=num Limit on increment loops + - is scalable with a suffix: k/K/m/M/g/G/t/T + - It must lie in one of the ranges: + -1 exactly, or + 1 to 16777216 + trace=KWd tracing level of detail + trace-out=str tracing output file or filter + used-defines Show the definitions used + - may not be preset +${testname} creates text files from templates using external definitions. + +The following option preset mechanisms are supported: + - reading file \$HOME/.${testname}rc + - reading file ./.${testname}rc + - examining environment variables named ` + echo ${testname} | tr 'a-z' 'A-Z'`_* + +The valid "trace" option keywords are: + nothing debug-message server-shell templates block-macros + expressions everything + or an integer from 0 through 6 + +${testname} is a tool designed for generating program files that contain +repetitive text with varied substitutions. +_EOF_ + +cmp -s ${testname}.h*lp || \ + failure "`diff ${testname}.hlp ${testname}.help`" + +cleanup |