From: <sg...@us...> - 2003-08-29 11:35:02
|
Update of /cvsroot/libfunutil/libfunutil/toc/tests In directory sc8-pr-cvs1:/tmp/cvs-serv22146 Added Files: toc_tests_help.sh Log Message: initial checkin --- NEW FILE: toc_tests_help.sh --- # toc_run_description = checks for --help-X and tries to do something about it. # toc_begin_help = # toc_tests_help looks for vars named help_* and tries to find help text for # tests matching that pattern (that is, help_foo looks for help for test foo). # To add help to your test wrap it in a block which begins with # the text 'tun_run_begin_help =' and end it with '= toc_run_end_help' # = toc_end_help helps="$(env | grep '^help_')" test -n "$helps" || return 0 for h in $helps; do test=${h##help_} test=${test%%=*} echo "help: $test" toc_find_test $test || { echo "Error: cannot find test $test." return 1 } scr=${TOC_FIND_RESULT} grep -q "toc_begin_help" $scr || { echo "No help text found." continue } sed -n '/^# *toc_begin_help *=/,/^#\ *= *toc_end_help/p' $scr | \ sed '/^# *toc_begin_help *=/d;/^# *= *toc_end_help/d;s/^# */ /;' done return 1 |