
# osm data files
rm -f ${TMPDIR}/osm-*
gpsbabel -i osm -f ${REFERENCE}/osm-data.xml -o gpx -F ${TMPDIR}/osm-data.gpx  -o osm -F ${TMPDIR}/osm-out.xml
compare ${REFERENCE}/osm-data.gpx ${TMPDIR}/osm-data.gpx 
compare ${REFERENCE}/osm-out.xml ${TMPDIR}/osm-out.xml

gpsbabel -i osm -f ${REFERENCE}/osm-center-data.xml -o gpx -F ${TMPDIR}/osm-center-data.gpx  -o osm -F ${TMPDIR}/osm-center-out.xml
compare ${REFERENCE}/osm-center-data.gpx ${TMPDIR}/osm-center-data.gpx 
compare ${REFERENCE}/osm-center-out.xml ${TMPDIR}/osm-center-out.xml

# FIXME: implement a test for OSM writer, if possible.
# compare ${REFERENCE}/osm-data.xml ${TMPDIR}/osm-out.xml 

# OK, we can't compare our output to osm generated reference files, but at least make sure we produce consistent output
gpsbabel -t -i unicsv,utc=0 -f ${REFERENCE}/osm_writer.csv -o osm,tagnd="amenity:pub;building:yes",tag="highway:motorway" -F ${TMPDIR}/osm_writer.xml
compare ${REFERENCE}/osm_writer.xml ${TMPDIR}/osm_writer.xml

