Browse Source

Add test mode for "dejagnu help" command

dejagnu-1.6.3
Jacob Bachmeyer 5 years ago
parent
commit
cc6b01a96e
  1. 7
      ChangeLog
  2. 15
      commands/help.sh
  3. 8
      testsuite/launcher.all/help.exp

7
ChangeLog

@ -4,6 +4,13 @@
* config.guess: Import patched version; patches sent upstream. * config.guess: Import patched version; patches sent upstream.
* commands/help.sh: Add test mode in which man(1) is never
actually invoked. The ability to reference a manpage by absolute
file name seems to be unique to Free systems.
* testsuite/launcher.all/help.exp: Amend test list to use new
testing mode in "dejagnu help" command. This mode should also
work on Solaris, so the logic for skipping the tests is removed.
2021-05-20 Jacob Bachmeyer <jcb@gnu.org> 2021-05-20 Jacob Bachmeyer <jcb@gnu.org>
* dejagnu: Search for a POSIX Awk and validate that at least a * dejagnu: Search for a POSIX Awk and validate that at least a

15
commands/help.sh

@ -40,6 +40,13 @@
# This script was written by Jacob Bachmeyer. # This script was written by Jacob Bachmeyer.
# For testing and development
in_test_mode=false
if test x"$1" = x--DGTest ; then
in_test_mode=true
shift
fi
args= args=
command=dejagnu command=dejagnu
verbose=0 verbose=0
@ -84,7 +91,11 @@ if expr "$verbose" \> 0 > /dev/null ; then
echo Forwarding to man $args "\"$command\"" echo Forwarding to man $args "\"$command\""
fi fi
#shellcheck disable=SC2086 if $in_test_mode ; then
exec man $args "$command" echo man "$args $command"
else
#shellcheck disable=SC2086
exec man $args "$command"
fi
#EOF #EOF

8
testsuite/launcher.all/help.exp

@ -21,10 +21,10 @@
# each element: { name args envars exit_code output_re... } # each element: { name args envars exit_code output_re... }
set tests { set tests {
{ "dejagnu help selects dejagnu(1) manpage" { "dejagnu help selects dejagnu(1) manpage"
{help -v} {MANPAGER=echo PAGER=echo} 0 {help --DGTest -v} {} 0
"Forwarding to man \".*doc/dejagnu\\.1\"" } "Forwarding to man \".*doc/dejagnu\\.1\"" }
{ "dejagnu help help selects dejagnu-help(1) manpage" { "dejagnu help help selects dejagnu-help(1) manpage"
{help -v help} {MANPAGER=echo PAGER=echo} 0 {help --DGTest -v help} {} 0
"Forwarding to man \".*doc/dejagnu-help\\.1\"" } "Forwarding to man \".*doc/dejagnu-help\\.1\"" }
} }
@ -32,10 +32,6 @@ if { ![file isdirectory [file join [file dirname $LAUNCHER] commands]] } {
skip_dejagnu_launcher_tests \ skip_dejagnu_launcher_tests \
"The 'commands' directory is not present in the source tree." \ "The 'commands' directory is not present in the source tree." \
unsupported $tests unsupported $tests
} elseif { [istarget *-*-solaris*] } {
skip_dejagnu_launcher_tests \
"The 'man' command in Solaris does not work in the source tree." \
unsupported $tests
} else { } else {
run_dejagnu_launcher_tests $LAUNCHER $tests run_dejagnu_launcher_tests $LAUNCHER $tests
} }

Loading…
Cancel
Save