texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[8014] info test suite reorganise shell snippet files


From: gavinsmith0123
Subject: [8014] info test suite reorganise shell snippet files
Date: Tue, 7 Aug 2018 10:27:33 -0400 (EDT)

Revision: 8014
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8014
Author:   gavin
Date:     2018-08-07 10:27:31 -0400 (Tue, 07 Aug 2018)
Log Message:
-----------
info test suite reorganise shell snippet files

Modified Paths:
--------------
    trunk/info/t/Init-inter.inc

Modified: trunk/info/t/Init-inter.inc
===================================================================
--- trunk/info/t/Init-inter.inc 2018-08-07 14:04:48 UTC (rev 8013)
+++ trunk/info/t/Init-inter.inc 2018-08-07 14:27:31 UTC (rev 8014)
@@ -13,12 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Initialize test of interactive operation
-# This file is to be sourced, not run directly
-
-# Skip test if pseudotty wasn't built
-test -x pseudotty || exit 77
-
 #  we may look up whether a couple of utilities exist.
 
 path_sep=":"
@@ -47,51 +41,61 @@
   return 1
 }
 
-# 
-# Avoid ginfo complaining that terminal is too dumb
-TERM=vt100; export TERM
+# Initialize test of interactive operation
+init_interactive_test ()
+{
+  test -v initialization_done && return 0
+  initialization_done=1
 
-# See cleanup in Init-test.inc.
-findprog stty && { STTY=stty ; reset_required=yes ; }
-test $reset_required=yes && { $STTY | grep [-]echo ; } && reset_required=no
-
-# Create named pipes to communicate with pseudotty program, or quit.
-rm -f $PIPEIN $PTY_TYPE # must already be defined
-if findprog mkfifo; then
-  mkfifo $PIPEIN
-  mkfifo $PTY_TYPE
-  #
-  if test ! -r $PIPEIN || test ! -r $PTY_TYPE; then
-    echo "$0: could not mkfifo pipes" >&2
+  # Skip test if pseudotty wasn't built
+  test -x pseudotty || exit 77
+  
+  # Avoid ginfo complaining that terminal is too dumb
+  TERM=vt100; export TERM
+  
+  # See 'cleanup' function
+  findprog stty && { STTY=stty ; reset_required=yes ; }
+  test $reset_required=yes && { $STTY | grep [-]echo ; } && reset_required=no
+  
+  # Create named pipes to communicate with pseudotty program, or quit.
+  rm -f $PIPEIN $PTY_TYPE # must already be defined
+  if findprog mkfifo; then
+    mkfifo $PIPEIN
+    mkfifo $PTY_TYPE
+    #
+    if test ! -r $PIPEIN || test ! -r $PTY_TYPE; then
+      echo "$0: could not mkfifo pipes" >&2
+      exit 77
+    fi
+    # ok, we'll proceed with the test.
+  else
+    echo "$0: mkfifo program not found - cannot make named pipes" >&2
     exit 77
   fi
-  # ok, we'll proceed with the test.
-else
-  echo "$0: mkfifo program not found - cannot make named pipes" >&2
-  exit 77
-fi
+  
+  # We can feed input bytes into $PTY_TYPE to be passed onto ginfo, as
+  # if they were typed by a user in an interactive session.
+  # We redirect to the FIFO within a subshell, because under NetBSD 6.1.4
+  # it hangs otherwise.
+  (exec ./pseudotty "$PTY_TYPE" >$PIPEIN) &
+  PTY_PID=$!
+  # Get name of pseudo-terminal slave device
+  read PTS_DEVICE <$PIPEIN
+  
+  # Keeping the FIFO open for writing prevents the select call in
+  # pseudotty returning EOF after a single "printf something >$PTY_TYPE".
+  exec 7>$PTY_TYPE
+  
+  # glibc can kill a running process if it detects a condition like a
+  # double free.  This specifies that the message it prints when it does
+  # this should be sent to stderr so it can be recorded in the test *.log
+  # files.
+  LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR
+}
 
-# We can feed input bytes into $PTY_TYPE to be passed onto ginfo, as
-# if they were typed by a user in an interactive session.
-# We redirect to the FIFO within a subshell, because under NetBSD 6.1.4
-# it hangs otherwise.
-(exec ./pseudotty "$PTY_TYPE" >$PIPEIN) &
-PTY_PID=$!
-# Get name of pseudo-terminal slave device
-read PTS_DEVICE <$PIPEIN
-
-# Keeping the FIFO open for writing prevents the select call in
-# pseudotty returning EOF after a single "printf something >$PTY_TYPE".
-exec 7>$PTY_TYPE
-
-# glibc can kill a running process if it detects a condition like a
-# double free.  This specifies that the message it prints when it does
-# this should be sent to stderr so it can be recorded in the test *.log
-# files.
-LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR
-
 run_ginfo ()
 {
+  init_interactive_test
   (
     exec 7>&- ; # Close fd from parent shell
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]