[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to m4/tests/builtins.at,v
From: |
Eric Blake |
Subject: |
Changes to m4/tests/builtins.at,v |
Date: |
Thu, 05 Oct 2006 23:07:31 +0000 |
CVSROOT: /sources/m4
Module name: m4
Changes by: Eric Blake <ericb> 06/10/05 23:07:28
Index: tests/builtins.at
===================================================================
RCS file: /sources/m4/m4/tests/builtins.at,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- tests/builtins.at 4 Oct 2006 23:30:46 -0000 1.20
+++ tests/builtins.at 5 Oct 2006 23:07:28 -0000 1.21
@@ -137,8 +137,37 @@
hostname = >>www<<
]])
-AT_CLEANUP
+dnl Ensure that esyscmd does not inherit any unnecessary fds from trace.
+AT_DATA([in.m4], [[esyscmd(`echo hi >&3')dnl
+]])
+AT_CHECK_M4([3>&-], [0], [], [stderr], [in.m4])
+mv stderr experr
+AT_CHECK_M4([--debugfile=trace -tdnl 3>&-], [0], [], [experr], [in.m4])
+AT_CHECK([cat trace], [0], [[m4trace: -1- dnl
+]])
+
+dnl Ensure that esyscmd does not inherit any unnecessary fds from diversions.
+AT_DATA([in.m4], [M4_ONE_MEG_DEFN[divert(`1')f
+world
+divert`'esyscmd(`echo hi >&3')
+hello
+]])
+AT_CHECK_M4([3>&-], [0], [[hello
+world
+]], [experr], [in.m4 | sed -ne '/./p'])
+
+dnl Ensure that esyscmd does not inherit any unnecessary fds from input files.
+AT_DATA([in.m4], [[hello esyscmd(`cat <&3')dnl
+dnl this line should not be read by cat
+world
+]])
+AT_CHECK_M4([3>&-], [0], [[hello world
+]], [stderr], [in.m4])
+mv stderr experr
+AT_CHECK_M4([in.m4 3>&-], [0], [[hello world
+]], [experr])
+AT_CLEANUP
## --- ##
@@ -594,6 +623,44 @@
AT_CLEANUP
+## ------ ##
+## syscmd ##
+## ------ ##
+
+AT_SETUP([syscmd])
+
+dnl Ensure that syscmd does not inherit any unnecessary fds from trace.
+AT_DATA([in.m4], [[syscmd(`echo hi >&3')dnl
+]])
+AT_CHECK_M4([3>&-], [0], [], [stderr], [in.m4])
+mv stderr experr
+AT_CHECK_M4([--debugfile=trace -tdnl 3>&-], [0], [], [experr], [in.m4])
+AT_CHECK([cat trace], [0], [[m4trace: -1- dnl
+]])
+
+dnl Ensure that syscmd does not inherit any unnecessary fds from diversions.
+AT_DATA([in.m4], [M4_ONE_MEG_DEFN[divert(`1')f
+world
+divert`'syscmd(`echo hi >&3')
+hello
+]])
+AT_CHECK_M4([3>&-], [0], [[hello
+world
+]], [experr], [in.m4 | sed -ne '/./p'])
+
+dnl Ensure that syscmd does not inherit any unnecessary fds from input files.
+AT_DATA([in.m4], [[hello syscmd(`cat <&3')dnl
+dnl this line should not be read by cat
+world
+]])
+AT_CHECK_M4([3>&-], [0], [[hello world
+]], [stderr], [in.m4])
+mv stderr experr
+AT_CHECK_M4([in.m4 3>&-], [0], [[hello world
+]], [experr])
+
+AT_CLEANUP
+
## -------- ##
## translit ##
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/04
- Changes to m4/tests/builtins.at,v,
Eric Blake <=
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/06
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/12
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/20
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/21
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/26
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/26
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/27
- Changes to m4/tests/builtins.at,v, Eric Blake, 2006/10/31