#! /bin/sh # -*- Mode: Shell-script -*- # ---------------------------------------------------------------------- # cond.test --- test conditionally compiled option # # Time-stamp: "2007-07-04 10:12:50 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: cond.test,v 4.10 2007/07/04 21:36:39 bkorb Exp $ # ---------------------------------------------------------------------- . ./defs # # # # # # # # # # DEFINITIONS FILE # # # # # # # # # echo "creating ${testname}.def in `pwd`" testname="${testname}" test_main="${test_main}" \ argument="${argument}" long_opts="${long_opts}" \ ${SHELLX} ${stdopts} option:'opt init' second=020 || \ failure "Could not run stdopts.def" cat >> ${testname}.def < ${testname}.hlp <<'_EOF_' test_cond - Test AutoOpts for cond USAGE: cond [ - [] ]... Flg Arg Option-Name Description -o Str option The option option descrip -s Num second The second option descrip -? no help Display usage information and exit -! no more-help Extended usage information passed thru pager _EOF_ cmp -s ${testname}.h*lp || \ failure "`diff ${testname}.h*lp`" INC="${INC} -DCOND=1" compile "-?" cat > ${testname}.hlp <<'_EOF_' test_cond - Test AutoOpts for cond USAGE: cond [ - [] ]... Flg Arg Option-Name Description -o Str option The option option descrip -s Num second The second option descrip -c no condition cond test -? no help Display usage information and exit -! no more-help Extended usage information passed thru pager _EOF_ cmp -s ${testname}.h*lp || \ failure "`diff ${testname}.h*lp`" echo guard-option-names\; >> ${testname}.def echo ${AG_L} ${testname}.def ${AG_L} ${testname}.def || \ failure AutoGen could not process ( eval `echo ${cc_cmd} | \ sed 's/-Werror//;s/-DTEST_TEST/-DSECOND -DTEST_TEST/' ` 2>&1 ) \ | sed -n 's/.*#warning:*/#warning/p' > ${testname}-cc.log echo '#warning undefining SECOND due to option name conflict' \ > ${testname}-xx.log cmp -s ${testname}-??.log || \ failure "warning diffs: `diff ${testname}-??.log`" cleanup ## Local Variables: ## Mode: shell-script ## indent-tabs-mode: nil ## sh-indentation: 2 ## End: # end of cond.test