summaryrefslogtreecommitdiff
path: root/ezbench.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-08-10 16:50:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-08-13 19:06:43 +0100
commit82568664a4843f3d09c4b629e1b2aa519ebab274 (patch)
tree4741c3ecd0537ee6c5ba9b63476c66b62b88feec /ezbench.sh
parentfde02415352e25df439c0fce1977764379687a65 (diff)
core: Allow tests to invert the ratio
Not all tests are fps (or operations per second) and instead measure duration. For these, we need to invert the ratio between tests.
Diffstat (limited to 'ezbench.sh')
-rwxr-xr-xezbench.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/ezbench.sh b/ezbench.sh
index 6684d47..8e2973b 100755
--- a/ezbench.sh
+++ b/ezbench.sh
@@ -175,6 +175,7 @@ last_commit=$(tail -1 $commitListLog 2>/dev/null | cut -f 1 -d ' ')
# Generate the actual list of tests
typeset -A testNames
+typeset -A testInvert
typeset -A testPrevFps
typeset -A testFilter
total_tests=0
@@ -184,6 +185,7 @@ echo -n "Tests that will be run: "
for test_dir in ${testsDir:-$ezBenchDir/tests.d}; do
for test_file in $test_dir/**/*.test; do
unset test_name
+ unset test_invert
unset test_exec_time
source $test_file || continue
@@ -203,6 +205,7 @@ for test_dir in ${testsDir:-$ezBenchDir/tests.d}; do
fi
testNames[$total_tests]=$t
+ testInvert[$total_tests]=$test_invert
last_result="$logsFolder/${last_commit}_result_${t}"
if [ -e "$logsFolder/${last_commit}_result_${t}" ]; then
@@ -354,7 +357,11 @@ do
then
testPrevFps[$t]=$result
fi
- fpsDiff=$(echo "scale=3;($result * 100.0 / ${testPrevFps[$t]}) - 100" | bc 2>/dev/null)
+ if [ -z "${testInvert[$t]}" ]; then
+ fpsDiff=$(echo "scale=3;($result * 100.0 / ${testPrevFps[$t]}) - 100" | bc 2>/dev/null)
+ else
+ fpsDiff=$(echo "scale=3;(100.0 * ${testPrevFps[$t]} / $result) - 100" | bc 2>/dev/null)
+ fi
[ $? -eq 0 ] && testPrevFps[$t]=$result
if (( $(bc -l <<< "$fpsDiff < -1.5" 2>/dev/null || echo 0) )); then
color=$bad_color