texinfo-commits
[Top][All Lists]
Advanced

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

[5710] timeout interactive info tests


From: Gavin D. Smith
Subject: [5710] timeout interactive info tests
Date: Tue, 15 Jul 2014 13:05:37 +0000

Revision: 5710
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5710
Author:   gavin
Date:     2014-07-15 13:05:36 +0000 (Tue, 15 Jul 2014)
Log Message:
-----------
timeout interactive info tests

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/t/Cleanup.inc
    trunk/info/t/Init-inter.inc
    trunk/info/t/adjust-anchors.sh
    trunk/info/t/body-start.sh
    trunk/info/t/end-of-line.sh
    trunk/info/t/goto-quoted.sh
    trunk/info/t/index-apropos.sh
    trunk/info/t/index-long-nodeline.sh
    trunk/info/t/index.sh
    trunk/info/t/menu-sequence.sh
    trunk/info/t/search-after-tag.sh
    trunk/info/t/split-file-menu.sh
    trunk/info/t/split-index.sh
    trunk/info/t/tab.sh

Added Paths:
-----------
    trunk/info/t/Timeout-test.inc

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/ChangeLog     2014-07-15 13:05:36 UTC (rev 5710)
@@ -1,3 +1,18 @@
+2014-07-15  Gavin Smith  <address@hidden>
+
+       * info/t/Init-inter.inc (run_ginfo): New function to wrap call of
+       program for interactive tests.
+       * info/t/Timeout-test.inc: New file.
+       * info/t/Cleanup.inc: Indicate test failure if program timed out.
+       * info/t/adjust-anchors.sh, info/t/body-start.sh,
+       info/t/end-of-line.sh, info/t/goto-quoted.sh, info/t/index.sh,
+       info/t/index-long-nodeline.sh, info/t/menu-sequence.sh,
+       info/t/search-after-tag.sh, info/t/split-file-menu.sh,
+       info/t/split-index.sh, info/t/tab.sh: Use run_ginfo and
+       Timout-test.inc.
+       * info/t/index-apropos.sh: Remove --restore option from ginfo
+       invocation.
+
 2014-07-14  Gavin Smith  <address@hidden>
 
        * info/session.c (info_handle_pointer, info_select_reference): Return

Modified: trunk/info/t/Cleanup.inc
===================================================================
--- trunk/info/t/Cleanup.inc    2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/Cleanup.inc    2014-07-15 13:05:36 UTC (rev 5710)
@@ -5,4 +5,8 @@
 rm -f $0.pipein $0.pipeout
 test $PTY_PID -ne 0 && kill $PTY_PID
 
+if test -v TIMED_OUT
+then
+  return 1
+fi
 exit $RETVAL

Modified: trunk/info/t/Init-inter.inc
===================================================================
--- trunk/info/t/Init-inter.inc 2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/Init-inter.inc 2014-07-15 13:05:36 UTC (rev 5710)
@@ -45,3 +45,11 @@
 # files.
 export LIBC_FATAL_STDERR_=1
 
+run_ginfo ()
+{
+  rm -f $0.finished
+  mkfifo $0.finished
+  { $GINFO "$@" ; echo finished >$0.finished ; } 0<>$PTS_DEVICE 1<&0 &
+}
+
+

Added: trunk/info/t/Timeout-test.inc
===================================================================
--- trunk/info/t/Timeout-test.inc                               (rev 0)
+++ trunk/info/t/Timeout-test.inc       2014-07-15 13:05:36 UTC (rev 5710)
@@ -0,0 +1,27 @@
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Shell script snippet.  Wait for program to finish.
+
+read -t 3 FINISHED <>$0.finished
+rm -f $0.finished
+if ! test "$FINISHED" = finished
+then
+  echo 'Program timed out after 3 seconds' >&2
+  TIMED_OUT=1
+
+  # We could kill ginfo here if we had its PID.  However, it will probably exit
+  # with an I/O error when pseudotty is killed in Cleanup.inc.
+fi

Modified: trunk/info/t/adjust-anchors.sh
===================================================================
--- trunk/info/t/adjust-anchors.sh      2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/adjust-anchors.sh      2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,12 +18,16 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc
 
-# Go to anchor in a UTF-8 encoded file. 
-1>$PTY_TYPE \
-  printf 
'ganchor-2\r\002\002\002\002\002\002\002\002\002\002\002\002\002\002\rDq' &
+export LANG=en_US.iso8859-1
+run_ginfo -f anchors
 
-LANG=en_US.iso8859-1 $GINFO -f anchors
+# Go to anchor in a UTF-8 encoded file when the current character encoding is
+# supposed to be ISO-8859-1
+printf 'ganchor-2\r\002\002\002\002\002\002' >$PTY_TYPE
+printf '\002\002\002\002\002\002\002\002\rDq' >$PTY_TYPE
 
+. $t/Timeout-test.inc
+
 if ! test -f $GINFO_OUTPUT
 then
        RETVAL=1

Modified: trunk/info/t/body-start.sh
===================================================================
--- trunk/info/t/body-start.sh  2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/body-start.sh  2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,10 +18,12 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc
 
+run_ginfo -f body-start
 # Check that node headers aren't included in searches
 printf 'sPotential match\r\rDq' >$PTY_TYPE &
-$GINFO -f body-start
 
+. $t/Timeout-test.inc
+
 if ! test -f $GINFO_OUTPUT
 then
        RETVAL=1

Modified: trunk/info/t/end-of-line.sh
===================================================================
--- trunk/info/t/end-of-line.sh 2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/end-of-line.sh 2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,10 +18,12 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc
 
+run_ginfo -f intera
 # Check that typing C-e on an empty line doesn't go to previous line
-printf '\x0e\x0e\x0e\x0e\x0e\x05\x0e\rDq' >$PTY_TYPE &
-$GINFO -f intera
+printf '\x0e\x0e\x0e\x0e\x0e\x05\x0e\rDq' >$PTY_TYPE
 
+. $t/Timeout-test.inc
+
 if ! test -f $GINFO_OUTPUT
 then
        RETVAL=1

Modified: trunk/info/t/goto-quoted.sh
===================================================================
--- trunk/info/t/goto-quoted.sh 2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/goto-quoted.sh 2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,10 +18,12 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc
 
+run_ginfo -f quoting
 # Go to a node with colons and commas in its name with "g"
-printf 'g\tColo\t\r\t\rDq' >$PTY_TYPE &
-$GINFO -f quoting
+printf 'g\tColo\t\r\t\rDq' >$PTY_TYPE
 
+. $t/Timeout-test.inc
+
 if ! test -f $GINFO_OUTPUT
 then
        RETVAL=1

Modified: trunk/info/t/index-apropos.sh
===================================================================
--- trunk/info/t/index-apropos.sh       2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/index-apropos.sh       2014-07-15 13:05:36 UTC (rev 5710)
@@ -22,7 +22,7 @@
 # result. Then type "i" followed by <TAB> to check the indices in the
 # file are still there.
 printf '\033xindex-apropos\rlink\r\t\ri\t\x07q' >$PTY_TYPE &
-$GINFO --restore $t/index-apropos.drib
+$GINFO
 RETVAL=$?
 
 . $t/Cleanup.inc

Modified: trunk/info/t/index-long-nodeline.sh
===================================================================
--- trunk/info/t/index-long-nodeline.sh 2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/index-long-nodeline.sh 2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,10 +18,11 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc 
 
+run_ginfo -f split
 # Follow an menu item from the index node to a node where physical lines
 # don't match logical lines.
-printf 'gIndex\r\t\t\r\rDq' >$PTY_TYPE &
-$GINFO -f split
+printf 'gIndex\r\t\t\r\rDq' >$PTY_TYPE
+. $t/Timeout-test.inc
 
 if ! test -f $GINFO_OUTPUT
 then

Modified: trunk/info/t/index.sh
===================================================================
--- trunk/info/t/index.sh       2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/index.sh       2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,10 +18,12 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc 
 
+run_ginfo -f intera
 # Follow an index entry
-printf 'iabc\rDq' >$PTY_TYPE &
-$GINFO -f intera
+printf 'iabc\rDq' >$PTY_TYPE
 
+. $t/Timeout-test.inc
+
 if ! test -f $GINFO_OUTPUT
 then
        RETVAL=1

Modified: trunk/info/t/menu-sequence.sh
===================================================================
--- trunk/info/t/menu-sequence.sh       2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/menu-sequence.sh       2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,9 +18,10 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc
 
+run_ginfo -f intera
 # M-x menu-sequence
-printf '\033xmenu-sequence\rfile-menu,first,no,nod\rDq' >$PTY_TYPE &
-$GINFO -f intera
+printf '\033xmenu-sequence\rfile-menu,first,no,nod\rDq' >$PTY_TYPE
+. $t/Timeout-test.inc
 
 if ! test -f $GINFO_OUTPUT
 then

Modified: trunk/info/t/search-after-tag.sh
===================================================================
--- trunk/info/t/search-after-tag.sh    2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/search-after-tag.sh    2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,10 +18,12 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-intera.inc
 
+run_ginfo -f intera -n Searching
 # Search for text in a node that appears after an Info tag
-printf '/match\r\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\rDq' >$PTY_TYPE &
-$GINFO -f intera -n Searching
+printf '/match\r\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\rDq' >$PTY_TYPE
 
+. $t/Timeout-test.inc
+
 if ! test -f $GINFO_OUTPUT
 then
        RETVAL=1

Modified: trunk/info/t/split-file-menu.sh
===================================================================
--- trunk/info/t/split-file-menu.sh     2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/split-file-menu.sh     2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,11 +18,13 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc
 
+run_ginfo -f split 'Second'
+
 # Follow a menu entry in a split file to a node in a different subfile from
 # the one containing "Top".  Check that we arrived properly and remembered
 # that we are in a split file by going back to "Top" with "t".
-printf tDq >$PTY_TYPE &
-$GINFO -f split 'Second'
+printf tDq >$PTY_TYPE
+. $t/Timeout-test.inc
 
 if ! test -f $GINFO_OUTPUT
 then

Modified: trunk/info/t/split-index.sh
===================================================================
--- trunk/info/t/split-index.sh 2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/split-index.sh 2014-07-15 13:05:36 UTC (rev 5710)
@@ -20,8 +20,9 @@
 
 # Follow an index entry in a split file
 
-printf 'ientry text\r\rDq' >$PTY_TYPE &
-$GINFO -f split
+run_ginfo -f split
+printf 'ientry text\r\rDq' >$PTY_TYPE
+. $t/Timeout-test.inc
 
 if ! test -f $GINFO_OUTPUT
 then

Modified: trunk/info/t/tab.sh
===================================================================
--- trunk/info/t/tab.sh 2014-07-14 21:44:05 UTC (rev 5709)
+++ trunk/info/t/tab.sh 2014-07-15 13:05:36 UTC (rev 5710)
@@ -18,9 +18,10 @@
 . $srcdir/t/Init-test.inc
 . $t/Init-inter.inc
 
+run_ginfo -f intera
 # Tab to first link and follow it
-printf '\t\rDq' >$PTY_TYPE &
-$GINFO -f intera
+printf '\t\rDq' >$PTY_TYPE
+. $t/Timeout-test.inc
 
 if ! test -f $GINFO_OUTPUT
 then




reply via email to

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