[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [chutney/master] fixup! test: Add tests/unit-tests.sh



commit 2a0a85c62de94e7b5d290b3bbae132e26c6f11a1
Author: teor <teor@xxxxxxxxxxxxxx>
Date:   Mon Apr 8 11:06:08 2019 +1000

    fixup! test: Add tests/unit-tests.sh
---
 tests/unit-tests.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/unit-tests.sh b/tests/unit-tests.sh
index 91a1841..5abc7a9 100755
--- a/tests/unit-tests.sh
+++ b/tests/unit-tests.sh
@@ -26,7 +26,7 @@ test -n "$LOG_FILE"
 unset CHUTNEY_DEBUG
 export CHUTNEY_DEBUG
 lib/chutney/Debug.py | tee "$LOG_FILE"
-LOG_FILE_LINES=$(wc -l "$LOG_FILE" | tr -s " " | cut -d " " -f2)
+LOG_FILE_LINES=$(wc -l "$LOG_FILE" | sed -e "s/[^0-9]*\([0-9]*\).*/\1/")
 test "$LOG_FILE_LINES" -eq 1
 
 LOG_FILE=$(mktemp)
@@ -35,7 +35,7 @@ test -n "$LOG_FILE"
 
 export CHUTNEY_DEBUG=1
 lib/chutney/Debug.py | tee "$LOG_FILE"
-LOG_FILE_LINES=$(wc -l "$LOG_FILE" | tr -s " " | cut -d " " -f2)
+LOG_FILE_LINES=$(wc -l "$LOG_FILE" | sed -e "s/[^0-9]*\([0-9]*\).*/\1/")
 test "$LOG_FILE_LINES" -eq 2
 
 unset CHUTNEY_DEBUG
@@ -68,9 +68,9 @@ PYTHONPATH=$PYTHONPATH:lib lib/chutney/Traffic.py 9999 | tee "$LOG_FILE"
 
 # Traffic.py produces output with a single newline. But we don't want to get
 # too picky about the details: allow an extra line and a few extra chars.
-LOG_FILE_LINES=$(wc -l "$LOG_FILE" | tr -s " " | cut -d " " -f2)
+LOG_FILE_LINES=$(wc -l "$LOG_FILE" | sed -e "s/[^0-9]*\([0-9]*\).*/\1/")
 test "$LOG_FILE_LINES" -le 2
-LOG_FILE_CHARS=$(wc -c "$LOG_FILE" | tr -s " " | cut -d " " -f2)
+LOG_FILE_CHARS=$(wc -c "$LOG_FILE" | sed -e "s/[^0-9]*\([0-9]*\).*/\1/")
 test "$LOG_FILE_CHARS" -le 4
 
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits