# Test KML reader.
# Coverage here is lower than in our writer, but this is somewhat OK
# as real world usage shows our writer is more frequently used than our
# reader.

# gpsbabel -i geo -f ${REFERENCE}/geocaching.loc -o unicsv -F ${TMPDIR}/geocaching.txt
gpsbabel -i kml -f ${REFERENCE}/kml-points.kml -o unicsv -F ${TMPDIR}/geo~unicsv.txt
compare ${REFERENCE}/kml-points.txt ${TMPDIR}/geo~unicsv.txt

gpsbabel -i kml -f ${REFERENCE}/track/google_ext.kml -o gpx -F ${TMPDIR}/google_ext~kml.gpx
compare ${REFERENCE}/track/google_ext~kml.gpx ${TMPDIR}/google_ext~kml.gpx

# All output lines starting with "L" are comments. Remove them,
# because gpsbabel writes a comment containing its version number,
# which will make this test fail, if the version changes.
gpsbabel -i kml -f ${REFERENCE}/track/skydrop.kml -o igc -F - | grep -v "^L" > ${TMPDIR}/skydrop~kml.igc
compare ${REFERENCE}/track/skydrop~kml.igc ${TMPDIR}/skydrop~kml.igc

# Track with empty gx:coord elements.
gpsbabel -i kml -f ${REFERENCE}/track/opentracks.kml -o gpx -F ${TMPDIR}/opentracks~kml.gpx
compare ${REFERENCE}/track/opentracks~kml.gpx ${TMPDIR}/opentracks~kml.gpx
