Skip to content

v0.2.48..v0.2.49 changeset PertyScoreCmdTest.sh

Garret Voltz edited this page Oct 2, 2019 · 1 revision
diff --git a/test-files/cmd/glacial/PertyScoreCmdTest.sh b/test-files/cmd/glacial/PertyScoreCmdTest.sh
new file mode 100755
index 0000000..99e7173
--- /dev/null
+++ b/test-files/cmd/glacial/PertyScoreCmdTest.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -e
+
+mkdir -p $HOOT_HOME/test-output/cmd/glacial/PertyScoreCmdTest
+
+inputfile=$HOOT_HOME/test-files/DcGisRoads.osm
+outdir=$HOOT_HOME/test-output/cmd/glacial/PertyScoreCmdTest/
+
+myCmd="hoot perty -D perty.systematic.error.x=1 \
+                        -D perty.systematic.error.y=1 \
+                        $inputfile $outdir --score"
+score=`$myCmd | grep "PERTY" | sed "s/PERTY Score: //g"`
+target_score="0.950"
+
+# Commented out since we don't have "bc" everywhere
+# result=`echo $score'>='$target_score | bc`
+# if [ result ]; then
+if [ $(awk '{printf($1 >= $2) ? 1 : 0}' <<<" $score $target_score ") -eq "1" ] ; then
+  echo "PERTY score greater than or equal to $target_score"
+else
+  echo "PERTY score ($score) LESS THAN $target_score"
+fi
Clone this wiki locally