about summary refs log tree commit homepage
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-02-04 10:36:18 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-04 10:36:18 +0000
commit85223902e8229bd460ce0b4ad126f42b1db42a46 (patch)
tree3407b8227d44c24831cc2fc186773537780e5778 /t/test-lib.sh
parenta09a622b4988b5eee819487c96a4563e71f753f7 (diff)
downloadunicorn-85223902e8229bd460ce0b4ad126f42b1db42a46.tar.gz
"date +%s" is not in POSIX (it is in GNU, and at least FreeBSD
9.0, possibly earlier).  The Ruby equivalent should be
sufficiently portable between different Ruby versions.

This change was automated via:
    perl -i -p -e 's/date \+%s/unix_time/' t/*.sh

This is commit 0ba6fc3c30b9cf530faf7fcf5ce7be519ec13fe7
in rainbows.git
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 7979111..6d0fa22 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -32,6 +32,11 @@ wait_for_pid () {
         done
 }
 
+# "unix_time" is not in POSIX, but in GNU, and FreeBSD 9.0 (possibly earlier)
+unix_time () {
+        $RUBY -e 'puts Time.now.to_i'
+}
+
 # given a list of variable names, create temporary files and assign
 # the pathnames to those variables
 rtmpfiles () {