texinfo-commits
[Top][All Lists]
Advanced

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

[6176] info tests cleanup on signal


From: Gavin D. Smith
Subject: [6176] info tests cleanup on signal
Date: Tue, 03 Mar 2015 17:21:25 +0000

Revision: 6176
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6176
Author:   gavin
Date:     2015-03-03 17:21:23 +0000 (Tue, 03 Mar 2015)
Log Message:
-----------
info tests cleanup on signal

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/t/Init-test.inc
    trunk/info/t/Timeout-test.inc

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-03-03 16:08:05 UTC (rev 6175)
+++ trunk/ChangeLog     2015-03-03 17:21:23 UTC (rev 6176)
@@ -1,5 +1,12 @@
 2015-03-03  Gavin Smith  <address@hidden>
 
+       * info/t/Init-test.inc: Trap SIGINT.
+       (cleanup): Kill the subshell that launched ginfo and delete FIFO 
+       file for communicating that subshell was finished.
+       * info/t/Timeout-test.inc: Clear SUBSHELL shell variable.
+
+2015-03-03  Gavin Smith  <address@hidden>
+
        * info/infodoc.c (info_get_info_help_node): If in a help
        window, close it before loading the tutorial.
 

Modified: trunk/info/t/Init-test.inc
===================================================================
--- trunk/info/t/Init-test.inc  2015-03-03 16:08:05 UTC (rev 6175)
+++ trunk/info/t/Init-test.inc  2015-03-03 17:21:23 UTC (rev 6176)
@@ -48,6 +48,7 @@
 # Not an interactive test
 PTY_PID=0
 WEDGE_PTY_PID=0
+SUBSHELL=0
 
 # Get error messages in English
 LC_ALL=C; export LC_ALL
@@ -55,16 +56,21 @@
 # Make sure that non-interactive operation works even if terminal is dumb
 TERM=dumb; export TERM
 
+# Clean up if the test is interrupted, for example if the user types
+# C-c, to avoid lingering child processes.
+trap cleanup SIGINT
+
 # Cleanup and exit
 cleanup ()
 {
   # Delete created files and kill spawned processes if any.
   test $PTY_PID -ne 0 && kill $PTY_PID
-  
   test $WEDGE_PTY_PID -ne 0 && kill $WEDGE_PTY_PID
+  test $SUBSHELL -ne 0 && kill $SUBSHELL
 
   rm -f $GINFO_OUTPUT
   rm -f $PIPEIN $PTY_TYPE
+  rm -f $FINISHEDFIFO
   
   if test -n "$TIMED_OUT"; then
     return 1

Modified: trunk/info/t/Timeout-test.inc
===================================================================
--- trunk/info/t/Timeout-test.inc       2015-03-03 16:08:05 UTC (rev 6175)
+++ trunk/info/t/Timeout-test.inc       2015-03-03 17:21:23 UTC (rev 6176)
@@ -39,5 +39,8 @@
   TIMED_OUT=1
 fi
 
+# Subshell is gone, so avoid trying to kill it in cleanup
+SUBSHELL=0
+
 rm -f $FINISHEDFIFO
 




reply via email to

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