Skip to content

v0.2.48..v0.2.49 changeset PertyCmdTest.sh

Garret Voltz edited this page Oct 2, 2019 · 1 revision
diff --git a/test-files/cmd/glacial/PertyCmdTest.sh b/test-files/cmd/glacial/PertyCmdTest.sh
new file mode 100755
index 0000000..f3cfbb7
--- /dev/null
+++ b/test-files/cmd/glacial/PertyCmdTest.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -e
+
+mkdir -p $HOOT_HOME/test-output/cmd/glacial/PertyCmdTest
+
+# Compare to known-good
+inputfile=$HOOT_HOME/test-files/DcGisRoads.osm
+testfile=$HOOT_HOME/test-files/cmd/glacial/PertyCmdTest/p_out.osm
+outputfile=$HOOT_HOME/test-output/cmd/glacial/PertyCmdTest/p_out.osm
+
+# Run the command. Note that we sanitize output to remove 
+# number of nodes reprojected, because this is variable
+hoot perty -D perty.search.distance=20 \
+           -D random.way.generalizer.probability=0.7 \
+           $inputfile \
+           $outputfile |\
+           sed "s/^Reprojecting.*$//g"
+
+# TODO: use the random seeding feature in perty, then we can check for the match
+# hoot diff $testfile $outputfile || diff $testfile $outputfile
Clone this wiki locally