about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-01-24 22:59:16 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-01 21:46:27 +0000
commitcbff7b0892148b037581541184364e0e91d2a138 (patch)
tree0a747c049c943330b9e0331798d679e0e85791c2 /t
parenta552fb90230eb65c28897398c7786dc9a13446ca (diff)
POSIX already stipulates tee(1) must be unbuffered.  I think my
decision to use utee was due to my being misled by a bug in
older curl where -N did not work as advertised (but --no-buffer
did).
Diffstat (limited to 't')
-rwxr-xr-xt/bin/utee12
-rwxr-xr-xt/t0200-async-response.sh6
-rwxr-xr-xt/t0202-async-response-one-oh.sh6
-rwxr-xr-xt/t0300-async_sinatra.sh6
4 files changed, 9 insertions, 21 deletions
diff --git a/t/bin/utee b/t/bin/utee
deleted file mode 100755
index 7b61fea..0000000
--- a/t/bin/utee
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env ruby
-# -*- encoding: binary -*-
-# tee(1) as distributed on most(all?) systems is buffered in luserspace
-# this only does unbuffered writes (with line-buffered input) to make
-# test output appear in real-time
-$stdin.binmode
-$stdout.binmode
-fp = File.open(ARGV.shift, "wb")
-$stdin.each_line do |line|
-  fp.syswrite line
-  $stdout.syswrite line
-end
diff --git a/t/t0200-async-response.sh b/t/t0200-async-response.sh
index 11917f0..7b2bc49 100755
--- a/t/t0200-async-response.sh
+++ b/t/t0200-async-response.sh
@@ -26,9 +26,9 @@ t_begin "setup and start" && {
 
 t_begin "send async requests off in parallel" && {
         t0=$(date +%s)
-        ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | utee $a) &
-        ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | utee $b) &
-        ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | utee $c) &
+        ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | tee $a) &
+        ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | tee $b) &
+        ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | tee $c) &
         wait
         t1=$(date +%s)
 }
diff --git a/t/t0202-async-response-one-oh.sh b/t/t0202-async-response-one-oh.sh
index 80ffc1f..49b6cac 100755
--- a/t/t0202-async-response-one-oh.sh
+++ b/t/t0202-async-response-one-oh.sh
@@ -18,9 +18,9 @@ t_begin "setup and start" && {
 t_begin "send async requests off in parallel" && {
         t0=$(date +%s)
         curl="curl -0 --no-buffer -vsSf http://$listen/"
-        ( $curl 2>> $a_err | utee $a) &
-        ( $curl 2>> $b_err | utee $b) &
-        ( $curl 2>> $c_err | utee $c) &
+        ( $curl 2>> $a_err | tee $a) &
+        ( $curl 2>> $b_err | tee $b) &
+        ( $curl 2>> $c_err | tee $c) &
         wait
         t1=$(date +%s)
 }
diff --git a/t/t0300-async_sinatra.sh b/t/t0300-async_sinatra.sh
index a623916..ef612b8 100755
--- a/t/t0300-async_sinatra.sh
+++ b/t/t0300-async_sinatra.sh
@@ -25,9 +25,9 @@ t_begin "setup and start" && {
 
 t_begin "send async requests off in parallel" && {
         t0=$(date +%s)
-        ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | utee $a) &
-        ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | utee $b) &
-        ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | utee $c) &
+        ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $a) &
+        ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $b) &
+        ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $c) &
 }
 
 t_begin "ensure elapsed requests were processed in parallel" && {