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)
pull/5/head
Peter Meerwald-Stadler 3 years ago
parent 0af164582f
commit b9a65a1269

@ -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
}

Loading…
Cancel
Save