imposm3/test/Makefile

30 lines
616 B
Makefile
Raw Normal View History

2016-01-04 13:19:28 +03:00
.PHONY: all test clean files
2013-08-30 19:20:07 +04:00
2013-11-13 16:30:41 +04:00
ifdef VERBOSE
2015-12-21 14:54:36 +03:00
TESTOPTS = -v
2013-11-13 16:30:41 +04:00
else
2015-12-21 14:54:36 +03:00
TESTOPTS =
2013-11-13 16:30:41 +04:00
endif
2015-12-21 14:54:36 +03:00
all: test
2013-08-30 19:20:07 +04:00
clean:
rm generated/*.{pbf,gz}
2013-08-30 19:20:07 +04:00
PBF_FILES=$(addprefix generated/,$(patsubst %.osm,%.pbf,$(wildcard *.osm)))
OSCGZ_FILES=$(addprefix generated/,$(patsubst %.osc,%.osc.gz,$(wildcard *.osc)))
2015-12-21 14:54:36 +03:00
generated/%.pbf: %.osm
2016-01-04 13:19:28 +03:00
osmosis --read-xml $< --sort type="TypeThenId" --write-pbf $@ omitmetadata=true
2013-08-30 19:20:07 +04:00
generated/%.osc.gz: %.osc
gzip --stdout $< > $@
2013-08-30 19:20:07 +04:00
2016-01-04 13:19:28 +03:00
files: $(PBF_FILES) $(OSCGZ_FILES)
test: files
2016-04-27 10:45:07 +03:00
(cd .. && go test ./test $(TESTOPTS))
2016-01-04 13:19:28 +03:00
route_relation: files
2016-04-27 10:45:07 +03:00
(cd .. && go test -test.run TestRouteRelation_ ./test $(TESTOPTS))