bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] sigpipe handling test fails without controlling terminal


From: Paul Eggert
Subject: Re: [Bug-tar] sigpipe handling test fails without controlling terminal
Date: Fri, 26 Nov 2010 19:45:05 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

On 11/08/2010 07:41 AM, Sven Joachim wrote:
> Test 112 fails in tar 1.24 and 1.25 if there is no controlling terminal
> (like when run in Emacs' compilation-mode).  Test log is attached. 

Thanks for the bug report.  I think it's a bug in the test suite, not in
tar itself.  I installed the following patch.

>From 306a5c5ef615c74ad60144283a61f965adc387ac Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Fri, 26 Nov 2010 19:35:20 -0800
Subject: [PATCH] tests: skip SIGPIPE-dependent tests in environments ignoring 
SIGPIPE

Problem reported by Sven Joachim in
<http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00043.html>.
* tests/remfiles01.at: Use AT_SIGPIPE_PREREQ.
* tests/sigpipe.at: Likewise.
* tests/testsuite.at (AT_SIGPIPE_PREREQ): New macro.
---
 tests/remfiles01.at |    1 +
 tests/sigpipe.at    |    2 ++
 tests/testsuite.at  |   10 +++++++++-
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/tests/remfiles01.at b/tests/remfiles01.at
index 6212efb..1fb0fad 100644
--- a/tests/remfiles01.at
+++ b/tests/remfiles01.at
@@ -32,6 +32,7 @@ unset TAR_OPTIONS
 AT_CHECK([
 AT_UNPRIVILEGED_PREREQ
 AT_GZIP_PREREQ
+AT_SIGPIPE_PREREQ
 AT_SORT_PREREQ
 
 mkdir dir
diff --git a/tests/sigpipe.at b/tests/sigpipe.at
index 4a3282b..dff94f6 100644
--- a/tests/sigpipe.at
+++ b/tests/sigpipe.at
@@ -26,6 +26,8 @@ AT_KEYWORDS([sigpipe])
 #             <address@hidden>
 
 AT_CHECK([
+AT_SIGPIPE_PREREQ
+
 genfile --length 2048 --file first
 genfile --length 2048 --file second
 genfile --length 2049 --file third
diff --git a/tests/testsuite.at b/tests/testsuite.at
index e8df868..55b8447 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -1,7 +1,8 @@
 # Process this file with autom4te to create testsuite. -*- Autotest -*-
 
 # Test suite for GNU tar.
-# Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 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
@@ -80,6 +81,13 @@ m4_define([AT_GZIP_PREREQ],[
 cat /dev/null | m4_if([$1],[],gzip,[$1]) - > /dev/null 2>&1 || AT_SKIP_TEST
 ])
 
+dnl AT_SIGPIPE_PREREQ - Skip test unless SIGPIPE handling is the default
+m4_define([AT_SIGPIPE_PREREQ],[
+case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #(
+?*) AT_SKIP_TEST;;
+esac
+])
+
 dnl AT_SORT_PREREQ - Skip test if sort utility outputs unwanted data on stderr
 m4_define([AT_SORT_PREREQ],[
 test -z "`sort < /dev/null 2>&1`" || AT_SKIP_TEST
-- 
1.7.2




reply via email to

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