From dfaba5a3e644d71f81bad917c1e97b6967f31d27 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Tue, 2 Feb 2016 12:21:19 -0800 Subject: [PATCH] Spell out a fuzz test for the four input-reading code paths --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 1887849..c30bace 100644 --- a/Makefile +++ b/Makefile @@ -74,6 +74,22 @@ test: tippecanoe tippecanoe-decode $(addsuffix .check,$(TESTS)) cmp $(patsubst %.check,%,$@) $@.out rm $@.out $@.mbtiles +parallel-test: + mkdir -p tests/parallel + perl -e 'for ($$i = 0; $$i < 300000; $$i++) { $$lon = rand(360) - 180; $$lat = rand(180) - 90; print "{ \"type\": \"Feature\", \"properties\": { }, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ $$lon, $$lat ] } }\n"; }' > tests/parallel/in.json + ./tippecanoe -z5 -f -pi -l test -n test -o tests/parallel/linear-file.mbtiles tests/parallel/in.json + ./tippecanoe -z5 -f -pi -l test -n test -P -o tests/parallel/parallel-file.mbtiles tests/parallel/in.json + cat tests/parallel/in.json | ./tippecanoe -z5 -f -pi -l test -n test -o tests/parallel/linear-pipe.mbtiles + cat tests/parallel/in.json | ./tippecanoe -z5 -f -pi -l test -n test -P -o tests/parallel/parallel-pipe.mbtiles + ./tippecanoe-decode tests/parallel/linear-file.mbtiles > tests/parallel/linear-file.json + ./tippecanoe-decode tests/parallel/parallel-file.mbtiles > tests/parallel/parallel-file.json + ./tippecanoe-decode tests/parallel/linear-pipe.mbtiles > tests/parallel/linear-pipe.json + ./tippecanoe-decode tests/parallel/parallel-pipe.mbtiles > tests/parallel/parallel-pipe.json + cmp tests/parallel/linear-file.json tests/parallel/parallel-file.json + cmp tests/parallel/linear-file.json tests/parallel/linear-pipe.json + cmp tests/parallel/linear-file.json tests/parallel/parallel-pipe.json + rm tests/parallel/*.mbtiles tests/parallel/*.json + # Use this target to regenerate the standards that the tests are compared against # after making a change that legitimately changes their output