#!/bin/sh

#
# XCSV "human readable" tests
#
rm -f ${TMPDIR}/humanread.out
gpsbabel -i xcsv,style=${REFERENCE}/humanread.style -f ${REFERENCE}/human.in -o arc -F ${TMPDIR}/humanread.out
compare ${REFERENCE}/humanread.out ${TMPDIR}/humanread.out


#
# XCSV "path distance" test
#
rm -f ${TMPDIR}/pathdist.out
gpsbabel -i gpx -f ${REFERENCE}/dusky.gpx -o xcsv,style=${REFERENCE}/gnuplot.style -F ${TMPDIR}/pathdist.out
compare ${REFERENCE}/dusky.gnuplot ${TMPDIR}/pathdist.out

#
# 'tabsep' isn't really tested in any non-trivial way, but we do exercise
# it.
#

gpsbabel -i geo -f ${REFERENCE}/geocaching.loc  -o tabsep -F ${TMPDIR}/tabsep.in
gpsbabel -i tabsep -f ${TMPDIR}/tabsep.in -o geo -F ${TMPDIR}/tabsep.out
gpsbabel -i geo -f ${REFERENCE}/geocaching.loc  -o geo -F ${TMPDIR}/geotabsep.out
compare ${TMPDIR}/tabsep.out ${TMPDIR}/geotabsep.out

#
# Now do the same for custom - it has the same issues.
#

gpsbabel -i geo -f ${REFERENCE}/geocaching.loc  -o custom -F ${TMPDIR}/custom.in
gpsbabel -i custom -f ${TMPDIR}/custom.in -o geo -F ${TMPDIR}/custom.out
gpsbabel -i geo -f ${REFERENCE}/geocaching.loc  -o geo -F ${TMPDIR}/geocustom.out

#
# Write something to the various output-only formats
#
gpsbabel -i geo -f ${REFERENCE}/geocaching.loc -o text -F ${TMPDIR}/text.out -o html -F ${TMPDIR}/html.out -o vcard -F ${TMPDIR}/vcard.out #-o palmdoc -F ${TMPDIR}/pd.out

