From b9a65a1269a542cb4034fec58ed9715e017d072f Mon Sep 17 00:00:00 2001 From: Peter Meerwald-Stadler Date: Tue, 27 Apr 2021 16:10:48 +0200 Subject: [PATCH] compare_testfiles.sh: pass Python code via -c pass Python code via -c instead of feeding to STDIN; on my system (Ubuntu) the later just measures the time to feed the code, not the execution (resulting in 0.00s runtime being reported) --- tests/compare_testfiles.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compare_testfiles.sh b/tests/compare_testfiles.sh index 0d6e938..8812793 100755 --- a/tests/compare_testfiles.sh +++ b/tests/compare_testfiles.sh @@ -25,7 +25,7 @@ wctest() pythontest() { - OUT=`(time echo "print str(sum(1 for line in open('$1'))) + ' $1'" | python) 2>&1 | grep real | cut -f 2 | cut -c 3-` + OUT=`(time python -c "print str(sum(1 for line in open('$1'))) + ' $1'") 2>&1 | grep real | cut -f 2 | cut -c 3-` echo "python: $1 $OUT" return 0 }