From e845a25ea64bee9f6903df6b8ac8b20702430e1d Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Sun, 1 Feb 2015 20:35:11 +0000 Subject: [PATCH] Unittest - Replace the timestamp function on wrapper.sh * %N is not supported by /bin/date on BSD systems --- test/basetest/hooks.py | 2 +- test/test_hooks/wrapper.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/basetest/hooks.py b/test/basetest/hooks.py index a66d44b34..c53b7b760 100644 --- a/test/basetest/hooks.py +++ b/test/basetest/hooks.py @@ -441,7 +441,7 @@ class LoggedHook(Hook): for k1 in log: # Timestamps if k1 == "calls": - timestamp = lambda x: datetime.fromtimestamp(int(x) / 1e9) + timestamp = lambda x: datetime.fromtimestamp(float(x)) newlog[k1] = map(timestamp, log[k1]) elif k1 in ("input", "output"): diff --git a/test/test_hooks/wrapper.sh b/test/test_hooks/wrapper.sh index 86a8513d4..0dee55eb1 100644 --- a/test/test_hooks/wrapper.sh +++ b/test/test_hooks/wrapper.sh @@ -6,7 +6,7 @@ IN="${ORIGINALHOOK}.log.in" OUT="${ORIGINALHOOK}.log.out" # Let it know that we were executed -echo "% Called at $(date +%s%N)" >> ${IN} +echo "% Called at $(python -c 'import time; print(time.time())')" >> ${IN} # Log what arrives via stdin to ${IN} and what comes via stdout to ${OUT} $ORIGINALHOOK < <(tee -a ${IN}) > >(tee -a ${OUT})