threads / patch / 33469

patcht: make PIPE a standard test prerequisite

Subject: [PATCH] t: make PIPE a standard test prerequisite

## tl;dr

One message between Apr 11, 2013 and Apr 11, 2013. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Adam Spiers· Apr 11, 2013, 02:07 UTC · lore

The 'PIPE' test prerequisite was already defined identically by t9010 and t9300, therefore it makes sense to make it a predefined prerequisite.

Signed-off-by: Adam Spiers <git@adamspiers.org>
---
My first attempt at writing a test for check-ignore's new streaming
behaviour involved mkfifo, during which I noticed this code duplication.
 t/README               | 5 +++++
 t/t9010-svn-fe.sh      | 8 --------
 t/t9300-fast-import.sh | 8 --------
 t/test-lib.sh          | 5 +++++
 4 files changed, 10 insertions(+), 16 deletions(-)
Show changes to 4 files +10 −16

t/README, t/t9010-svn-fe.sh, t/t9300-fast-import.sh, t/test-lib.sh

diff --git a/t/README b/t/README
index 9b41fe7..70e49fc 100644
--- a/t/README
+++ b/t/README
@@ -619,6 +619,11 @@ use these, and "test_set_prereq" for how to define your own.
    The process retains the same pid across exec(2). See fb9a2bea for
    details.
 
+ - PIPE
+
+   The filesystem we're on supports creation of FIFOs (named pipes)
+   via mkfifo(1).
+
  - SYMLINKS
 
    The filesystem we're on supports symbolic links. E.g. a FAT
diff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh
index b7eed24..6dafe7e 100755
--- a/t/t9010-svn-fe.sh
+++ b/t/t9010-svn-fe.sh
@@ -54,14 +54,6 @@ text_no_props () {
 
 >empty
 
-test_expect_success 'setup: have pipes?' '
-	rm -f frob &&
-	if mkfifo frob
-	then
-		test_set_prereq PIPE
-	fi
-'
-
 test_expect_success PIPE 'empty dump' '
 	reinit_git &&
 	echo "SVN-fs-dump-format-version: 2" >input &&
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 2fcf269..ac6f3b6 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -49,14 +49,6 @@ echo "$@"'
 
 >empty
 
-test_expect_success 'setup: have pipes?' '
-	rm -f frob &&
-	if mkfifo frob
-	then
-		test_set_prereq PIPE
-	fi
-'
-
 ###
 ### series A
 ###
diff --git a/t/test-lib.sh b/t/test-lib.sh
index da57a2f..debd8b4 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -735,6 +735,11 @@ test_i18ngrep () {
 	fi
 }
 
+test_lazy_prereq PIPE '
+	# test whether the filesystem supports FIFOs
+	rm -f testfifo && mkfifo testfifo
+'
+
 test_lazy_prereq SYMLINKS '
 	# test whether the filesystem supports symbolic links
 	ln -s x y && test -h y
-- 
1.8.2.1.347.g37e0606

← back to recent threads