1@echo off
2REM
3REM Simple Windows NT/2000/XP .cmd version of GPSBabel testo script
4REM
5
6SET GPSBABEL_FREEZE_TIME=y
7SET TMPDIR=%TEMP%\WINTESTO
8MKDIR %TMPDIR% 2>NUL:
9
10GOTO :REALSTART
11
12REM ==================================
13
14:CommonCOMPARE
15SET PARAM1=%2
16SET PARAM2=%3
17REM Test if param3 was a dir rather than a file, if so add a \* to make fc work
18FOR %%A IN (%3) DO IF "d--------"=="%%~aA" SET PARAM2=%3\*
19FOR /f "delims=" %%a IN ('fc %PARAM1% %PARAM2%') DO IF "x%%a"=="xFC: no differences encountered" GOTO :EOF
20REM Show the first 5 lines of difference
21fc %1 /LB5 %PARAM1% %PARAM2%
22if errorlevel 1 ECHO %* are not the same (first 5 differences above) - pausing. ^C to quit if required
23if errorlevel 1 PAUSE
24GOTO :EOF
25
26REM ==================================
27
28:COMPARE
29CALL :CommonCOMPARE /L %1 %2
30GOTO :EOF
31
32REM ==================================
33
34:BINCOMPARE
35CALL :CommonCOMPARE /B %1 %2
36GOTO :EOF
37
38REM ==================================
39
40:SORTandCOMPARE
41SORT <%1 >%TMPDIR%\s1
42SORT <%2 >%TMPDIR%\s2
43CALL :COMPARE %TMPDIR%\s1 %TMPDIR%\s2
44GOTO :EOF
45
46REM ==================================
47
48:REALSTART
49
50
51REM Turn on GNU libc instrumentation.
52
53SET PNAME=.\gpsbabel
54IF NOT EXIST %PNAME%.EXE ECHO Can't find %PNAME%&& GOTO :EOF
55
56
57
58
59
60REM Some formats are just too boring to test.   The ones that
61REM are xcsv include
62REM garmin301
63REM garmin_poi
64REM gpsdrivetrack
65REM nima
66REM mapconverter
67REM geonet
68REM saplus
69REM s_and_t
70REM Geocaching .loc
71DEL %TMPDIR%\gl.loc
72@echo on
73@echo Testing...
74%PNAME% -i geo -f geocaching.loc -o geo -F %TMPDIR%\gl.loc
75@echo off
76@echo.
77CALL :COMPARE %TMPDIR%\gl.loc reference
78
79REM GPSUtil
80DEL %TMPDIR%\gu.wpt %TMPDIR%\1.gpx %TMPDIR%\2.gpx
81@echo on
82@echo Testing...
83%PNAME% -i geo -f geocaching.loc -o gpsutil -F %TMPDIR%\gu.wpt
84@echo off
85@echo.
86CALL :COMPARE %TMPDIR%\gu.wpt reference
87@echo on
88@echo Testing...
89%PNAME% -i gpsutil -f %TMPDIR%\gu.wpt -o gpx -F %TMPDIR%\1.gpx
90%PNAME% -i gpsutil -f reference\gu.wpt -o gpx -F %TMPDIR%\2.gpx
91@echo off
92@echo.
93CALL :COMPARE %TMPDIR%\1.gpx %TMPDIR%\2.gpx
94
95REM GPSman
96DEL %TMPDIR%\gm.gm %TMPDIR%\gm.gm+
97@echo on
98@echo Testing...
99%PNAME% -i geo -f geocaching.loc -o gpsman -F %TMPDIR%\gm.gm
100%PNAME% -i gpsman -f %TMPDIR%\gm.gm -o gpsutil -F %TMPDIR%\gm.gm+
101@echo off
102@echo.
103CALL :COMPARE %TMPDIR%\gm.gm+ %TMPDIR%\gu.wpt
104
105REM GPX
106DEL %TMPDIR%\gl.gpx %TMPDIR%\gpx.gpx
107@echo on
108@echo Testing...
109%PNAME% -i geo -f geocaching.loc -o gpx -F %TMPDIR%\gl.gpx
110%PNAME% -i gpx -f %TMPDIR%\gl.gpx -o gpsutil -F %TMPDIR%\gpx.gpx
111@echo off
112@echo.
113CALL :COMPARE %TMPDIR%\gpx.gpx %TMPDIR%\gu.wpt
114
115REM GTM
116DEL %TMPDIR%\gl.gpx %TMPDIR%\gpx.gpx
117@echo on
118@echo Testing...
119%PNAME% -i gtm -f reference\sample.gtm -o gpx -F %TMPDIR%\gtm1.gpx
120%PNAME% -i gpx -f %TMPDIR%\gtm1.gpx -o gtm -F %TMPDIR%\gtm.gtm
121%PNAME% -i gtm -f %TMPDIR%\gtm.gtm -o gpx -F %TMPDIR%\gtm2.gpx
122@echo off
123@echo.
124CALL :COMPARE %TMPDIR%\gtm1.gpx %TMPDIR%\gtm2.gpx
125CALL :COMPARE %TMPDIR%\gtm.gtm reference\sample.gtm
126
127REM Magellan Mapsend
128DEL %TMPDIR%\mm.mapsend %TMPDIR%\mm.gps
129@echo on
130@echo Testing...
131%PNAME% -i geo -f geocaching.loc -o mapsend -F %TMPDIR%\mm.mapsend
132%PNAME% -i mapsend -f %TMPDIR%\mm.mapsend -o gpsutil -F %TMPDIR%\mm.gps
133@echo off
134@echo.
135CALL :COMPARE %TMPDIR%\mm.gps %TMPDIR%\gu.wpt
136
137REM Magellan serial
138REM TODO
139
140REM Tiger
141REM This one is a little tacky, because it's a very lossy format.
142REM so we simply test we can write it, and then read it and write it and
143REM get an identical file back.
144DEL %TMPDIR%\tiger
145@echo on
146@echo Testing...
147%PNAME% -i geo -f geocaching.loc -o tiger -F %TMPDIR%\tiger
148%PNAME% -i tiger -f %TMPDIR%\tiger -o tiger -F %TMPDIR%\tiger2
149@echo off
150@echo.
151CALL :COMPARE %TMPDIR%\tiger %TMPDIR%\tiger2
152
153REM
154REM Lowrance USR.  Binary, and also slightly lossy because of the math to
155REM convert lat/long.  It also doesn't support description, which makes it
156REM awkward  to test.
157REM
158DEL %TMPDIR%\lowrance1.usr
159DEL %TMPDIR%\enchilada1.usr
160DEL %TMPDIR%\enchilada.gpx
161@echo on
162@echo Testing...
163%PNAME% -i geo -f geocaching.loc -o lowranceusr -F %TMPDIR%\lowrance1.usr
164@echo off
165@echo.
166CALL :BINCOMPARE %TMPDIR%\lowrance1.usr reference\lowrance.usr
167@echo on
168@echo Testing...
169%PNAME% -i lowranceusr -f %TMPDIR%\lowrance1.usr -o lowranceusr -F %TMPDIR%\lowrance1.usr
170@echo off
171@echo.
172REM And because of the FP rounding, we can't even read our file, write it back
173REM and get the same data.  Sigh.
174REM bincompare reference/lowrance.usr  ${TMPDIR}/lowrance1.usr
175@echo on
176@echo Testing...
177%PNAME% -i lowranceusr -f reference\all.usr -o gpx -F %TMPDIR%\enchilada.gpx
178%PNAME% -i gpx -f %TMPDIR%\enchilada.gpx -o lowranceusr -F %TMPDIR%\enchilada1.usr
179@echo off
180@echo.
181CALL :BINCOMPARE %TMPDIR%\enchilada1.usr reference\enchilada.usr
182REM Don't convert icons as waypts
183@echo on
184@echo Testing...
185%PNAME% -i lowranceusr,ignoreicons -f reference\all.usr -o gpx -F %TMPDIR%\enchilada.gpx
186%PNAME% -i gpx -f %TMPDIR%\enchilada.gpx -o lowranceusr -F %TMPDIR%\enchilada1.usr
187@echo off
188@echo.
189CALL :BINCOMPARE %TMPDIR%\enchilada1.usr reference\ignoreicons.usr
190
191REM CSV (Comma separated value) data.
192
193@echo on
194@echo Testing...
195%PNAME%  -i geo -f geocaching.loc -o csv -F %TMPDIR%\csv.csv
196%PNAME%  -i csv -f %TMPDIR%\csv.csv -o csv -F %TMPDIR%\csv2.csv
197@echo off
198@echo.
199CALL :COMPARE %TMPDIR%\csv2.csv %TMPDIR%\csv.csv
200
201REM
202REM Delorme TopoUSA 4 is a CSV strain.
203REM
204DEL %TMPDIR%\xmap-1.gpx %TMPDIR%\xmap-2.gpx %TMPDIR%\xmap
205@echo on
206@echo Testing...
207%PNAME% -i xmap -f reference\xmap -o xmap -F %TMPDIR%\xmap
208%PNAME% -i xmap -f reference\xmap -o gpx -F %TMPDIR%\xmap-1.gpx
209%PNAME% -i xmap -f %TMPDIR%\xmap -o gpx -F %TMPDIR%\xmap-2.gpx
210@echo off
211@echo.
212CALL :COMPARE %TMPDIR%\xmap-1.gpx %TMPDIR%\xmap-2.gpx
213CALL :COMPARE reference\xmap %TMPDIR%\xmap
214
215REM PCX (Garmin mapsource import) file format
216DEL %TMPDIR%\mm.pcx %TMPDIR%\pcx.gps
217@echo on
218@echo Testing...
219%PNAME% -i geo -f geocaching.loc -o pcx -F %TMPDIR%\mm.pcx
220%PNAME% -i pcx -f %TMPDIR%\mm.pcx -o gpsutil -F %TMPDIR%\pcx.gps
221@echo off
222@echo.
223CALL :COMPARE %TMPDIR%\mm.gps %TMPDIR%\gu.wpt
224@echo on
225@echo Testing...
226%PNAME% -t -i gpx -f reference\track\tracks.gpx -o pcx -F %TMPDIR%\pcx.trk
227%PNAME% -t -i pcx -f reference\track\pcx.trk -o pcx -F %TMPDIR%\pcx2.trk
228@echo off
229@echo.
230CALL :COMPARE %TMPDIR%\pcx.trk %TMPDIR%\pcx2.trk
231
232REM
233REM Magellan file format
234REM
235@echo on
236@echo Testing...
237%PNAME% -i magellan -f reference\magfile -o magellan -F %TMPDIR%\magfile
238@echo off
239@echo.
240CALL :COMPARE %TMPDIR%\magfile reference\magfile
241
242REM
243REM Magellanx is just like, but with longer names. (which this admittedly
244REM doesn't actually exercise...)
245REM
246@echo on
247@echo Testing...
248%PNAME% -i magellan -f reference\magfile -o magellanx -F %TMPDIR%\magfile2
249@echo off
250@echo.
251CALL :COMPARE %TMPDIR%\magfile2 reference\magfile
252
253REM Navitrak DNA marker format
254@echo on
255@echo Testing...
256%PNAME% -i dna -f reference\dnatest.txt -o dna -F %TMPDIR%\dnatest.txt
257@echo off
258@echo.
259CALL :COMPARE %TMPDIR%\dnatest.txt reference\dnatest.txt
260
261REM PSP (PocketStreets 2002 Pushpin (.PSP)) file format. Use mxf as an
262REM intermediate format to avoid binary FP anomalies on compareerent platforms.
263DEL %TMPDIR%\psp.mxf %TMPDIR%\mxf.psp
264@echo on
265@echo Testing...
266%PNAME% -i psp -f reference\ps.psp -o mxf -F %TMPDIR%\psp.mxf
267%PNAME% -i geo -f geocaching.loc -o mxf -F %TMPDIR%\mxf.psp
268@echo off
269@echo.
270CALL :COMPARE %TMPDIR%\psp.mxf %TMPDIR%\mxf.psp
271@echo on
272@echo Testing...
273%PNAME% -i psp -f reference\ps.psp -o gpx -F %TMPDIR%\psp1.gpx
274%PNAME% -i psp -f reference\ps.psp -o psp -F %TMPDIR%\xxx.psp
275%PNAME% -i psp -f %TMPDIR%\xxx.psp -o gpx -F %TMPDIR%\psp2.gpx
276@echo off
277@echo.
278CALL :COMPARE %TMPDIR%\psp1.gpx %TMPDIR%\psp2.gpx
279
280REM MXF (Maptech Exchange Format) file format
281DEL %TMPDIR%\mx.mxf %TMPDIR%\mxf.mxf
282@echo on
283@echo Testing...
284%PNAME% -i mxf -f reference\mxf.mxf -o mxf -F %TMPDIR%\mx.mxf
285%PNAME% -i mxf -f %TMPDIR%\mx.mxf -o mxf -F %TMPDIR%\mxf.mxf
286@echo off
287@echo.
288CALL :COMPARE %TMPDIR%\mxf.mxf reference
289
290REM tmpro (TopoMapPro Places) file format
291DEL %TMPDIR%\topomappro.txt %TMPDIR%\mxf.mxf
292@echo on
293@echo Testing...
294%PNAME% -i tmpro -f reference\topomappro.txt -o tmpro -F %TMPDIR%\tmp.txt
295%PNAME% -i tmpro -f %TMPDIR%\tmp.txt -o tmpro -F %TMPDIR%\topomappro.txt
296@echo off
297@echo.
298CALL :COMPARE %TMPDIR%\topomappro.txt reference
299
300REM TPG (NG Topo!) file format
301REM This is hard to test as the datum conversions create minute
302REM inconsistencies in the coordinates.  So..  we test our i/o
303REM against a format that rounds higher than we care to compare
304REM for binary data.
305DEL %TMPDIR%\topo.mxf %TMPDIR%\tpg.mxf %TMPDIR%\geo.tpg
306@echo on
307@echo Testing...
308%PNAME% -i geo -f geocaching.loc -o tpg -F %TMPDIR%\geo.tpg
309%PNAME% -i tpg -f %TMPDIR%\geo.tpg -o mxf -F %TMPDIR%\tpg.mxf
310%PNAME% -i tpg -f reference\tpg.tpg -o mxf -F %TMPDIR%\topo.mxf
311@echo off
312@echo.
313CALL :COMPARE %TMPDIR%\tpg.mxf %TMPDIR%\topo.mxf
314
315REM TPO (NG Topo!) file format
316REM This is hard to test as the datum conversions create minute
317REM inconsistencies in the coordinates. We have four reference files:
318REM tpo-sample1.tpo, tpo-sample1.gpx, tpo-sample2.gpx, and
319REM tpo-sample2.tpo.  These are used to check the conversion to/from
320REM TPO format.
321DEL %TMPDIR%\tpo-sample1.gpx %TMPDIR%\tpo-sample2.tpo
322@echo on
323@echo Testing...
324%PNAME% -t -i tpo -f reference\track\tpo-sample1.tpo -o gpx -F %TMPDIR%\tpo-sample1.gpx
325@echo off
326@echo.
327CALL :COMPARE %TMPDIR%\tpo-sample1.gpx reference\track\tpo-sample1.gpx
328REM ${PNAME} -t -i gpx -f reference/track/tpo-sample2.gpx -o tpo -F ${TMPDIR}/tpo-sample2.tpo
329REM bincompare ${TMPDIR}/tpo-sample2.tpo reference/track/tpo-sample2.tpo
330
331REM OZI (OziExplorer 1.1) file format
332DEL %TMPDIR%\oz.wpt %TMPDIR%\ozi.wpt
333@echo on
334@echo Testing...
335%PNAME% -i ozi -f reference\ozi.wpt -o ozi -F %TMPDIR%\oz.wpt
336%PNAME% -i ozi -f %TMPDIR%\oz.wpt -o ozi -F %TMPDIR%\ozi.wpt
337@echo off
338@echo.
339CALL :COMPARE %TMPDIR%\ozi.wpt reference
340
341REM Holux support is a little funky to test.  Becuase it loses precision,
342REM if we convert it to another format, we lose accuracy (rounding) in the
343REM coords, so converting it so something else and comparing it never works.
344REM So we verify that we can read the reference and write it and get an
345REM identical reference.
346@echo on
347@echo Testing...
348%PNAME% -i holux -f reference\paris.wpo -o holux -F %TMPDIR%\paris.wpo
349@echo off
350@echo.
351REM compare reference/paris.wpo ${TMPDIR}/paris.wpo
352
353REM Magellan NAV Companion for PalmOS
354REM This format is hard to test, because each record and the database itself
355REM contains the time of creation, so two otherwise identical files won't
356REM compare accurately.  In any case, the files are binary so compare wouldn't
357REM like them.  So, we convert the reference file to gpsutil and the converted
358REM file to gpsutil and make sure they're the same, and that they're the same
359REM as one converted on a known-working installation.  Unfortunately, this does
360REM not verify that the appinfo block was written correctly.  However, it does
361REM successfully test for some endianness errors that might otherwise go
362REM unnoticed.
363DEL %TMPDIR%\magnav.pdb %TMPDIR%\magnav.gpu %TMPDIR%\magnavt.gpu
364@echo on
365@echo Testing...
366%PNAME% -i geo -f geocaching.loc -o magnav -F %TMPDIR%\magnav.pdb
367%PNAME% -i magnav -f %TMPDIR%\magnav.pdb -o gpsutil -F %TMPDIR%\magnav.gpu
368%PNAME% -i magnav -f reference\magnav.pdb -o gpsutil -F %TMPDIR%\magnavt.gpu
369@echo off
370@echo.
371CALL :COMPARE %TMPDIR%\magnavt.gpu %TMPDIR%\magnav.gpu
372CALL :COMPARE reference\gu.wpt %TMPDIR%\magnav.gpu
373
374DEL %TMPDIR%\magnav.pdb
375@echo on
376@echo Testing...
377%PNAME% -i geo -f geocaching.loc -o magnav -F %TMPDIR%\magnav.pdb
378@echo off
379@echo.
380CALL :BINCOMPARE %TMPDIR%\magnav.pdb reference\magnav.pdb
381
382
383
384REM GPSPilot Tracker for PalmOS
385REM This test is eerily similar to the NAV Companion test.  In fact, the
386REM converted reference file (magnavr.gpu) is identical.
387DEL %TMPDIR%\gpspilot.pdb %TMPDIR%\gpspilot.gpu %TMPDIR%\gpspil_t.gpu
388@echo on
389@echo Testing...
390%PNAME% -i geo -f geocaching.loc -o gpspilot -F %TMPDIR%\gpspilot.pdb
391%PNAME% -i gpspilot -f %TMPDIR%\gpspilot.pdb -o gpsutil -F %TMPDIR%\gpspilot.gpu
392%PNAME% -i gpspilot -f reference\gpspilot.pdb -o gpsutil -F %TMPDIR%\gpspil_t.gpu
393@echo off
394@echo.
395CALL :COMPARE %TMPDIR%\gpspil_t.gpu %TMPDIR%\gpspilot.gpu
396CALL :COMPARE reference\gu.wpt %TMPDIR%\gpspilot.gpu
397
398REM Cetus GPS for PalmOS
399REM This test is also similar to the NAV Companion test.
400DEL %TMPDIR%\cetus.pdb %TMPDIR%\cetus.gpu %TMPDIR%\cetust.gpu
401@echo on
402@echo Testing...
403%PNAME% -i geo -f geocaching.loc -o cetus -F %TMPDIR%\cetus.pdb
404%PNAME% -i cetus -f %TMPDIR%\cetus.pdb -o gpsutil -F %TMPDIR%\cetus.gpu
405%PNAME% -i cetus -f reference\cetus.pdb -o gpsutil -F %TMPDIR%\cetust.gpu
406@echo off
407@echo.
408CALL :COMPARE %TMPDIR%\cetust.gpu %TMPDIR%\cetus.gpu
409CALL :COMPARE reference\cetus.gpu %TMPDIR%\cetus.gpu
410
411REM QuoVadis GPS for PalmOS
412REM This test is derived from the Cetus test above.
413DEL %TMPDIR%\quovadis.pdb %TMPDIR%\quovadis.gpu %TMPDIR%\quovadist.gpu
414@echo on
415@echo Testing...
416%PNAME% -i geo -f geocaching.loc -o quovadis -F %TMPDIR%\quovadis.pdb
417%PNAME% -i quovadis -f %TMPDIR%\quovadis.pdb -o gpsutil -F %TMPDIR%\quovadis.gpu
418%PNAME% -i quovadis -f reference\quovadis.pdb -o gpsutil -F %TMPDIR%\quovadist.gpu
419@echo off
420@echo.
421CALL :COMPARE %TMPDIR%\quovadist.gpu %TMPDIR%\quovadis.gpu
422CALL :COMPARE reference\quovadis.gpu %TMPDIR%\quovadis.gpu
423
424REM GpsDrive
425DEL %TMPDIR%\gpsdrive.txt
426@echo on
427@echo Testing...
428%PNAME% -i geo -f geocaching.loc -o gpsdrive -F %TMPDIR%\gpsdrive.txt
429@echo off
430@echo.
431CALL :COMPARE %TMPDIR%\gpsdrive.txt reference
432@echo on
433@echo Testing...
434%PNAME% -i gpsdrive -f reference\gpsdrive.txt -o gpsdrive -F %TMPDIR%\gpsdrive2.txt
435@echo off
436@echo.
437CALL :COMPARE %TMPDIR%\gpsdrive2.txt reference\gpsdrive.txt
438
439REM XMapHH Street Atlas USA file format
440DEL %TMPDIR%\xmapwpt.wpt %TMPDIR%\xmapwpt.xmapwpt
441@echo on
442@echo Testing...
443%PNAME% -i xmapwpt -f reference\xmapwpt.wpt -o xmapwpt -F %TMPDIR%\xmapwpt.xmapwpt
444%PNAME% -i xmapwpt -f %TMPDIR%\xmapwpt.xmapwpt -o xmapwpt -F %TMPDIR%\xmapwpt.wpt
445@echo off
446@echo.
447CALL :COMPARE %TMPDIR%\xmapwpt.wpt reference
448
449REM XCSV
450REM Test that we can parse a style file, and read and write data in the
451REM same xcsv format (a complete test is virtually impossible).
452ECHO RECORD_DELIMITER NEWLINE> %TMPDIR%\testo.style
453ECHO FIELD_DELIMITER COMMA>> %TMPDIR%\testo.style
454ECHO BADCHARS COMMA>> %TMPDIR%\testo.style
455ECHO PROLOGUE Header>> %TMPDIR%\testo.style
456ECHO EPILOGUE Footer>> %TMPDIR%\testo.style
457ECHO IFIELD SHORTNAME,,%%s>> %TMPDIR%\testo.style
458ECHO IFIELD LAT_DIRDECIMAL,,%%c%%lf>> %TMPDIR%\testo.style
459ECHO IFIELD LON_DECIMALDIR,,%%lf%%c>> %TMPDIR%\testo.style
460DEL %TMPDIR%\xcsv.geo %TMPDIR%\xcsv.xcsv
461@echo on
462@echo Testing...
463%PNAME% -i geo -f geocaching.loc -o xcsv,style=%TMPDIR%\testo.style -F %TMPDIR%\xcsv.geo
464%PNAME% -i xcsv,style=%TMPDIR%\testo.style -f %TMPDIR%\xcsv.geo -o xcsv,style=%TMPDIR%\testo.style -F %TMPDIR%\xcsv.xcsv
465@echo off
466@echo.
467CALL :COMPARE %TMPDIR%\xcsv.geo %TMPDIR%\xcsv.xcsv
468
469REM Garmin Mapsource This is a binary format with some undocumented
470REM fields.  This test is therefore intentionally vague.  We read a file,
471REM convert it to GPX, then write a file as MPS, then read it back and
472REM write it as GPX and compare them.  Since we're writing both GPX files
473REM ourselves from the same version, we're immune to changes in our own
474REM GPX output.
475
476@echo on
477@echo Testing...
478%PNAME% -i mapsource -f reference\mapsource.mps  -o gpx -F %TMPDIR%\ms1.gpx
479%PNAME% -i mapsource -f reference\mapsource.mps  -o mapsource -F %TMPDIR%\ms.mps
480%PNAME% -i mapsource -f %TMPDIR%\ms.mps -o gpx -F %TMPDIR%\ms2.gpx
481@echo off
482@echo.
483CALL :COMPARE %TMPDIR%\ms1.gpx %TMPDIR%\ms2.gpx
484
485REM
486REM MRCB mapsource track test
487REM
488DEL %TMPDIR%\mps-track.mps
489@echo on
490@echo Testing...
491%PNAME% -t -i mapsource -f reference\track\mps-track.mps -o mapsource,mpsverout=3 -F %TMPDIR%\mps-track.mps
492@echo off
493@echo.
494CALL :COMPARE %TMPDIR%\mps-track.mps reference\track
495REM Now do a test of reading waypoints from a track-only file - should have an empty result
496DEL %TMPDIR%\mps-track.mps
497@echo on
498@echo Testing...
499%PNAME% -i mapsource -f reference\track\mps-track.mps -o mapsource,mpsverout=3 -F %TMPDIR%\mps-track.mps
500@echo off
501@echo.
502CALL :COMPARE %TMPDIR%\mps-track.mps reference\mps-empty.mps
503
504REM
505REM MRCB mapsource route test
506REM
507DEL %TMPDIR%\mps-route.mps
508@echo on
509@echo Testing...
510%PNAME% -r -i mapsource -f reference\route\route.mps -o mapsource,mpsverout=4 -F %TMPDIR%\mps-route.mps
511@echo off
512@echo.
513CALL :COMPARE %TMPDIR%\mps-route.mps reference\route\route.mps
514
515REM Now do a test of reading tracks from a route-only file - should have an empty result
516DEL %TMPDIR%\mps-route.mps
517@echo on
518@echo Testing...
519%PNAME% -t -i mapsource -f reference\route\route.mps -o mapsource,mpsverout=3 -F %TMPDIR%\mps-route.mps
520@echo off
521@echo.
522CALL :COMPARE %TMPDIR%\mps-route.mps reference\mps-empty.mps
523
524REM
525REM Geocaching Database is a binary Palm format that, like the GPX variants
526REM has a zillion "equivalent" encodings of any given record set.  So we
527REM read the reference file, spin it to GPX and back to GCDB and then spin
528REM that one to GPX.
529REM
530
531@echo on
532@echo Testing...
533%PNAME% -i gcdb -f reference\GeocachingDB.PDB -o gpx -F %TMPDIR%\gcdb1.gpx -o gcdb -F %TMPDIR%\gcdb1.pdb
534%PNAME% -i gpx -f %TMPDIR%\gcdb1.gpx -o gpx -F %TMPDIR%\gcdb2.gpx
535@echo off
536@echo.
537CALL :COMPARE %TMPDIR%\gcdb1.gpx %TMPDIR%\gcdb1.gpx
538
539REM
540REM Duplicate filter - Since filters have no format of their own, we use csv
541REM as an intermediate format for testing the filter.
542REM
543DEL %TMPDIR%\filterdupe.csv1 %TMPDIR%\filterdupe.csv2
544@echo on
545@echo Testing...
546%PNAME% -i geo -f geocaching.loc -o csv -F %TMPDIR%\filterdupe.csv1
547%PNAME% -i geo -f geocaching.loc -f geocaching.loc -x duplicate,shortname -o csv -F %TMPDIR%\filterdupe.csv2
548@echo off
549@echo.
550CALL :SORTandCOMPARE %TMPDIR%\filterdupe.csv1 %TMPDIR%\filterdupe.csv2
551
552REM
553REM Position filter -  Since very small distances are essentialy a duplicate
554REM position filter, we can test very similarly to the duplicate filter.
555REM
556DEL %TMPDIR%\filterpos.csv1 %TMPDIR%\filterpos.csv2
557@echo on
558@echo Testing...
559%PNAME% -i geo -f geocaching.loc -o csv -F %TMPDIR%\filterpos.csv1
560%PNAME% -i geo -f geocaching.loc -f geocaching.loc -x position,distance=5f -o csv -F %TMPDIR%\filterpos.csv2
561@echo off
562@echo.
563CALL :SORTandCOMPARE %TMPDIR%\filterpos.csv1 %TMPDIR%\filterpos.csv2
564
565REM
566REM Radius filter
567REM
568DEL %TMPDIR%\radius.csv
569@echo on
570@echo Testing...
571%PNAME% -i geo -f geocaching.loc -x radius,lat=35.9720,lon=-87.1347,distance=14.7 -o csv -F %TMPDIR%\radius.csv
572@echo off
573@echo.
574CALL :COMPARE %TMPDIR%\radius.csv reference
575REM
576REM magellan SD card waypoint / route format
577REM
578DEL %TMPDIR%\magellan.rte
579@echo on
580@echo Testing...
581%PNAME% -r -i magellan -f reference\route\magellan.rte -o magellan -F %TMPDIR%\magellan.rte
582@echo off
583@echo.
584CALL :COMPARE %TMPDIR%\magellan.rte reference\route\magellan.rte
585
586
587REM
588REM GPX routes -- since GPX contains a date stamp, tests will always
589REM fail, so we use magellan as an interim format...
590REM
591DEL %TMPDIR%\gpxroute.gpx %TMPDIR%\maggpx.rte
592@echo on
593@echo Testing...
594%PNAME% -r -i gpx -f reference\route\route.gpx -o gpx -F %TMPDIR%\gpxroute.gpx
595%PNAME% -r -i gpx -f %TMPDIR%\gpxroute.gpx -o magellan -F %TMPDIR%\maggpx.rte
596@echo off
597@echo.
598CALL :COMPARE %TMPDIR%\maggpx.rte reference\route\magellan.rte
599
600REM
601REM GPX tracks -- since GPX contains a date stamp, tests will always
602REM fail, so we use magellan as an interim format...
603REM
604DEL %TMPDIR%\gpxtrack.gpx %TMPDIR%\maggpx.trk
605@echo on
606@echo Testing...
607%PNAME% -t -i gpx -f reference\track\tracks.gpx -o gpx -F %TMPDIR%\gpxtrack.gpx
608%PNAME% -t -i magellan -f reference\track\meridian.trk -o gpx -F %TMPDIR%\maggpx.trk
609@echo off
610@echo.
611CALL :COMPARE %TMPDIR%\maggpx.trk %TMPDIR%\gpxtrack.gpx
612
613REM
614REM MAPSEND waypoint / route format
615REM
616DEL %TMPDIR%\route.mapsend
617@echo on
618@echo Testing...
619%PNAME% -r -i mapsend -f reference\route\route.mapsend -o mapsend -F %TMPDIR%\route.mapsend
620@echo off
621@echo.
622CALL :BINCOMPARE %TMPDIR%\route.mapsend reference\route\route.mapsend
623
624REM
625REM MAPSEND track format
626REM
627DEL %TMPDIR%\mapsend.trk
628@echo on
629@echo Testing...
630%PNAME% -t -i mapsend -f reference\track\mapsend.trk -o mapsend -F %TMPDIR%\mapsend.trk
631@echo off
632@echo.
633CALL :COMPARE %TMPDIR%\mapsend.trk reference\track
634REM
635REM copilot
636REM
637DEL %TMPDIR%\copilot.pdb
638@echo on
639@echo Testing...
640%PNAME% -i copilot -f reference\UKultralight.pdb -o copilot -F %TMPDIR%\cop.pdb
641%PNAME% -i copilot -f reference\UKultralight.pdb -o gpx -F %TMPDIR%\cop1.gpx
642%PNAME% -i copilot -f %TMPDIR%\cop.pdb -o gpx -F %TMPDIR%\cop2.gpx
643@echo off
644@echo.
645CALL :COMPARE %TMPDIR%\cop1.gpx %TMPDIR%\cop2.gpx
646
647REM
648REM EasyGPS.   Another binary format.
649REM
650DEL %TMPDIR%\easy.loc
651@echo on
652@echo Testing...
653%PNAME% -i easygps -f reference\easygps.loc -o easygps -F %TMPDIR%\ez.loc
654%PNAME% -i easygps -f reference\easygps.loc -o gpx -F %TMPDIR%\ez1.gpx
655%PNAME% -i easygps -f %TMPDIR%\ez.loc -o gpx -F %TMPDIR%\ez2.gpx
656@echo off
657@echo.
658CALL :COMPARE %TMPDIR%\ez1.gpx %TMPDIR%\ez2.gpx
659
660REM
661REM GPilotS.   A Palm format.  Another binary format that
662REM
663REM rm -f ${TMPDIR/gpilots.l
664REM ${PNAME} -i easygps -f reference/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx
665@echo on
666@echo Testing...
667%PNAME% -i geo -f geocaching.loc -o gpilots -F %TMPDIR%\blah.pdb
668%PNAME% -i gpilots -f %TMPDIR%\blah.pdb -o gpx -F %TMPDIR%\1.gpx
669%PNAME% -i gpilots -f reference\gpilots.pdb -o gpx -F %TMPDIR%\2.gpx
670@echo off
671@echo.
672CALL :COMPARE %TMPDIR%\1.gpx %TMPDIR%\2.gpx
673REM ${PNAME} -i easygps -f reference/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx
674
675REM
676REM Navicache.
677@echo on
678@echo Testing...
679%PNAME% -i navicache -f reference\navicache.xml -o gpsutil -F %TMPDIR%\navi.wpt
680@echo off
681@echo.
682CALL :COMPARE %TMPDIR%\navi.wpt reference\navicache.ref
683REM
684
685REM
686REM CoastalExplorer..
687@echo on
688@echo Testing...
689%PNAME% -r -i coastexp -f reference\coastexp.nob -o gpx -F %TMPDIR%\coastexp.gpx
690@echo off
691@echo.
692CALL :COMPARE %TMPDIR%\coastexp.gpx reference\coastexp.ref
693@echo on
694@echo Testing...
695%PNAME% -r -i gpx -f %TMPDIR%\coastexp.gpx -o coastexp -F %TMPDIR%\coastexp.nob
696@echo off
697@echo.
698CALL :COMPARE %TMPDIR%\coastexp.nob reference\coastexp.ref2
699@echo on
700@echo Testing...
701%PNAME% -w -i coastexp -f reference\coastexp.nob -o gpx -F %TMPDIR%\coastexp.gpx
702@echo off
703@echo.
704CALL :COMPARE %TMPDIR%\coastexp.gpx reference\coastexp.ref3
705@echo on
706@echo Testing...
707%PNAME% -w -i gpx -f %TMPDIR%\coastexp.gpx -o coastexp -F %TMPDIR%\coastexp.nob
708@echo off
709@echo.
710CALL :COMPARE %TMPDIR%\coastexp.nob reference\coastexp.ref4
711REM
712
713REM PsiTrex.  A text format that can't be handled by XCSV due to context of
714REM data based on other data values in the file
715REM Waypoints first
716DEL %TMPDIR%\psit-ww.txt %TMPDIR%\psit-ww.mps
717@echo on
718@echo Testing...
719%PNAME% -i psitrex -f reference\psitwpts.txt -o mapsource -F %TMPDIR%\psit-ww.mps
720%PNAME% -i mapsource -f %TMPDIR%\psit-ww.mps -o psitrex -F %TMPDIR%\psit-ww.txt
721@echo off
722@echo.
723CALL :COMPARE reference\psitwpts.txt %TMPDIR%\psit-ww.txt
724
725REM Now test correct "empty" handling - ask for routes when there aren't any
726REM Uses mapsource as the empty handling for this has already happened above
727DEL %TMPDIR%\psit-wr.mps
728@echo on
729@echo Testing...
730%PNAME% -r -i psitrex -f reference\psitwpts.txt -o mapsource,mpsverout=3 -F %TMPDIR%\psit-wr.mps
731@echo off
732@echo.
733CALL :COMPARE reference\mps-empty.mps %TMPDIR%\psit-wr.mps
734
735REM Routes next
736DEL %TMPDIR%\psit-rr.txt %TMPDIR%\psit-rr.mps
737@echo on
738@echo Testing...
739%PNAME% -r -i psitrex -f reference\route\psitrtes.txt -o mapsource -F %TMPDIR%\psit-rr.mps
740%PNAME% -r -i mapsource -f %TMPDIR%\psit-rr.mps -o psitrex -F %TMPDIR%\psit-rr.txt
741@echo off
742@echo.
743CALL :COMPARE reference\route\psitrtes.txt %TMPDIR%\psit-rr.txt
744
745REM Now test correct "empty" handling - ask for tracks when there aren't any
746REM Uses mapsource as the empty handling for this has already happened above
747DEL %TMPDIR%\psit-rt.mps
748@echo on
749@echo Testing...
750%PNAME% -t -i psitrex -f reference\route\psitrtes.txt -o mapsource,mpsverout=3 -F %TMPDIR%\psit-rt.mps
751@echo off
752@echo.
753CALL :COMPARE reference\mps-empty.mps %TMPDIR%\psit-rt.mps
754
755REM Tracks last
756DEL %TMPDIR%\psit-tt.txt %TMPDIR%\psit-tt.mps
757@echo on
758@echo Testing...
759%PNAME% -t -i psitrex -f reference\track\psittrks.txt -o mapsource -F %TMPDIR%\psit-tt.mps
760%PNAME% -t -i mapsource -f %TMPDIR%\psit-tt.mps -o psitrex -F %TMPDIR%\psit-tt.txt
761@echo off
762@echo.
763CALL :COMPARE reference\track\psittrks.txt %TMPDIR%\psit-tt.txt
764
765REM Now test correct "empty" handling - ask for waypoints when there aren't any
766REM Uses mapsource as the empty handling for this has already happened above
767DEL %TMPDIR%\psit-tw.mps
768@echo on
769@echo Testing...
770%PNAME% -i psitrex -f reference\track\psittrks.txt -o mapsource,mpsverout=3 -F %TMPDIR%\psit-tw.mps
771@echo off
772@echo.
773CALL :COMPARE reference\mps-empty.mps %TMPDIR%\psit-tw.mps
774
775REM
776REM Arc Distance filter
777REM
778DEL %TMPDIR%\arcdist.txt
779@echo on
780@echo Testing...
781%PNAME% -i xmap -f reference\arcdist_input.txt -x arc,file=reference\arcdist_arc.txt,distance=1 -o xmap -F %TMPDIR%\arcdist.txt
782@echo off
783@echo.
784CALL :COMPARE %TMPDIR%\arcdist.txt reference\arcdist_output.txt
785
786REM
787REM Polygon filter
788REM
789DEL %TMPDIR%\polygon.txt
790@echo on
791@echo Testing...
792%PNAME% -i xmap -f reference\arcdist_input.txt -x polygon,file=reference\polygon_allencty.txt -o xmap -F %TMPDIR%\polygon.txt
793@echo off
794@echo.
795CALL :COMPARE %TMPDIR%\polygon.txt reference\polygon_output.txt
796
797REM
798REM Simplify filter
799REM
800DEL %TMPDIR%\simplify.txt
801@echo on
802@echo Testing...
803%PNAME% -r -i gpx -f reference\route\route.gpx -x simplify,count=10 -o arc -F %TMPDIR%\simplify.txt
804@echo off
805@echo.
806CALL :COMPARE %TMPDIR%\simplify.txt reference\simplify_output.txt
807
808REM
809REM Route reversal filter.   Do it twice and be sure we get what we
810REM started with.
811REM
812DEL %TMPDIR%\reverse1.arc %TMPDIR%\reverse2.arc %TMPDIR%\reference.arc
813@echo on
814@echo Testing...
815%PNAME% -r -i gpx -f reference\route\route.gpx -o arc -F %TMPDIR%\reference.arc
816%PNAME% -r -i gpx -f reference\route\route.gpx -x reverse -o arc -F %TMPDIR%\reverse1.arc
817%PNAME% -r -i gpx -f reference\route\route.gpx -x reverse -x reverse -o arc -F %TMPDIR%\reverse2.arc
818@echo off
819@echo.
820REM Verify the first and last are the same
821CALL :COMPARE %TMPDIR%\reference.arc  %TMPDIR%\reverse2.arc
822REM Verify the first and second are different.
823REM ${DIFF}  ${TMPDIR}/reverse1.arc  ${TMPDIR}/reverse2.arc > /dev/null && {
824REM 		echo ERROR Failed reversal test.
825REM 		exit 1
826REM }
827
828REM parkrrrr: This isn't a straightforward compare; we *want* it to fail.
829REM Obviously this test should just be rewritten with a new reference.
830REM compare  ${TMPDIR}/reverse1.arc  ${TMPDIR}/reverse2.arc
831
832REM
833REM Geoniche: No reference file was available, so we created one and just
834REM test it against itself.
835REM
836DEL %TMPDIR%\gn.pdb %TMPDIR%\1.gpx %TMPDIR%\2.gpx
837@echo on
838@echo Testing...
839%PNAME% -i geoniche -f reference\geoniche.pdb -o geoniche -F %TMPDIR%\gn.pdb
840%PNAME% -i geoniche -f reference\geoniche.pdb -o gpx -F %TMPDIR%\1.gpx
841%PNAME% -i geoniche -f %TMPDIR%\gn.pdb -o gpx -F %TMPDIR%\2.gpx
842@echo off
843@echo.
844CALL :COMPARE %TMPDIR%\1.gpx %TMPDIR%\2.gpx
845REM
846@echo on
847@echo Testing...
848%PNAME% -i geoniche -f reference\gn-targets.pdb -o gpx -F %TMPDIR%\gn-targets.gpx
849@echo off
850@echo.
851CALL :COMPARE %TMPDIR%\gn-targets.gpx reference\gn-targets.gpx
852
853REM
854REM saroute covers *.anr, *.rte, and *.rtd, but I only have an .anr for testing.
855REM Unfortunately for us, this is a read-only format for now.
856REM
857@echo on
858@echo Testing...
859%PNAME% -t -i saroute -f reference\track\i65.anr -o gpx -F %TMPDIR%\gpl1.gpx
860%PNAME% -t -i gpx -f reference\track\i65.anr.gpx -o gpx -F %TMPDIR%\gpl2.gpx
861@echo off
862@echo.
863CALL :COMPARE %TMPDIR%\gpl1.gpx %TMPDIR%\gpl2.gpx
864
865REM
866REM Delorme GPL file.   This is sort of a track format.
867REM
868DEL %TMPDIR%\gpl1.gpx %TMPDIR%\gpl2.gpx %TMPDIR%\gpl1.gpl
869@echo on
870@echo Testing...
871%PNAME% -t -i gpl -f reference\track\webpark1.gpl -o gpx -F %TMPDIR%\gpl1.gpx
872%PNAME% -t -i gpl -f reference\track\webpark1.gpl -o gpl -F %TMPDIR%\gpl1.gpl
873%PNAME% -t -i gpl -f %TMPDIR%\gpl1.gpl -o gpx -F %TMPDIR%\gpl2.gpx
874@echo off
875@echo.
876CALL :COMPARE %TMPDIR%\gpl1.gpx %TMPDIR%\gpl2.gpx
877
878REM
879REM NetStumbler Summary File (read-only)
880REM
881DEL %TMPDIR%\netstumbler.mps
882@echo on
883@echo Testing...
884%PNAME% -i netstumbler -f reference\netstumbler.txt -o mapsource -F %TMPDIR%\netstumbler.mps
885@echo off
886@echo.
887CALL :BINCOMPARE %TMPDIR%\netstumbler.mps reference\netstumbler.mps
888
889REM
890REM IGC tests
891REM
892DEL %TMPDIR%\igc*out
893@echo on
894@echo Testing...
895%PNAME% -i gpx -f reference\igc1.gpx -o igc -F %TMPDIR%\igc.out
896@echo off
897@echo.
898FINDSTR /V /R /C:"^LXXXGenerated by GPSBabel Version" %TMPDIR%\igc.out> %TMPDIR%\igc_sed.out
899CALL :COMPARE %TMPDIR%\igc_sed.out reference\igc1_igc.out
900
901@echo on
902@echo Testing...
903%PNAME% -i igc -f %TMPDIR%\igc.out -o gpx -F %TMPDIR%\igc.gpx
904@echo off
905@echo.
906CALL :COMPARE %TMPDIR%\igc.gpx reference\igc1_gpx.out
907
908@echo on
909@echo Testing...
910%PNAME% -i gpx -f %TMPDIR%\igc.gpx -o igc -F %TMPDIR%\igc.out
911@echo off
912@echo.
913FINDSTR /V /R /C:"^LXXXGenerated by GPSBabel Version" %TMPDIR%\igc.out> %TMPDIR%\igc_sed.out
914CALL :COMPARE %TMPDIR%\igc_sed.out reference\igc1_igc.out
915
916@echo on
917@echo Testing...
918%PNAME% -i gpx -f reference\igc1_baro.gpx -i igc -f reference\igc1_igc.out -o igc,timeadj=auto -F %TMPDIR%\igc.out
919@echo off
920@echo.
921FINDSTR /V /R /C:"^LXXXGenerated by GPSBabel Version" %TMPDIR%\igc.out> %TMPDIR%\igc_sed.out
922CALL :COMPARE %TMPDIR%\igc_sed.out reference\igc1_3d.out
923
924
925@echo on
926@echo Testing...
927%PNAME% -i igc -f reference\igc2.igc -o gpx -F %TMPDIR%\igc.gpx
928@echo off
929@echo.
930CALL :COMPARE %TMPDIR%\igc.gpx reference\igc2_gpx.out
931
932@echo on
933@echo Testing...
934%PNAME% -i gpx -f %TMPDIR%\igc.gpx -o igc -F %TMPDIR%\igc.out
935@echo off
936@echo.
937FINDSTR /V /R /C:"^LXXXGenerated by GPSBabel Version" %TMPDIR%\igc.out> %TMPDIR%\igc_sed.out
938CALL :COMPARE %TMPDIR%\igc_sed.out reference\igc2_igc.out
939
940@echo on
941@echo Testing...
942%PNAME% -i igc -f %TMPDIR%\igc.out -o gpx -F %TMPDIR%\igc.gpx
943@echo off
944@echo.
945CALL :COMPARE %TMPDIR%\igc.gpx reference\igc2_gpx.out
946
947REM
948REM Google Maps XML test
949REM
950DEL %TMPDIR%\google.out
951@echo on
952@echo Testing...
953%PNAME% -i google -f reference\google.xml -o csv -F %TMPDIR%\google.out
954@echo off
955@echo.
956CALL :COMPARE %TMPDIR%\google.out reference\google.csv
957
958DEL %TMPDIR%\google.out
959@echo on
960@echo Testing...
961%PNAME% -i google -f reference\google.js -o csv -F %TMPDIR%\google.out
962@echo off
963@echo.
964CALL :COMPARE %TMPDIR%\google.out reference\google.csv
965
966DEL %TMPDIR%\google.out
967@echo on
968@echo Testing...
969%PNAME% -i google -f reference\google_jan_06.html -o csv -F %TMPDIR%\google.out
970@echo off
971@echo.
972CALL :COMPARE %TMPDIR%\google.out reference\google_jan_06.csv
973
974REM
975REM DeLorme .an1 tests
976REM
977DEL %TMPDIR%\an1.out
978@echo on
979@echo Testing...
980%PNAME% -i an1 -f reference\foo.an1 -o csv -F %TMPDIR%\an1.out
981@echo off
982@echo.
983CALL :COMPARE %TMPDIR%\an1.out reference\an1-in.ref
984
985DEL %TMPDIR%\an1.out
986@echo on
987@echo Testing...
988%PNAME% -i an1 -f reference\foo.an1 -o an1 -F %TMPDIR%\an1.out
989@echo off
990@echo.
991CALL :BINCOMPARE %TMPDIR%\an1.out reference\an1-an1.ref
992
993DEL %TMPDIR%\an1.out
994@echo on
995@echo Testing...
996%PNAME% -i xmap -f reference\xmap -o an1 -F %TMPDIR%\an1.out
997@echo off
998@echo.
999CALL :BINCOMPARE %TMPDIR%\an1.out reference\an1-out.ref
1000
1001DEL %TMPDIR%\an1.out
1002@echo on
1003@echo Testing...
1004%PNAME% -i google -f reference\google.js -o an1 -F %TMPDIR%\an1.out
1005@echo off
1006@echo.
1007CALL :BINCOMPARE %TMPDIR%\an1.out reference\an1-line-out.ref
1008
1009REM
1010REM TomTom .ov2 tests
1011REM
1012
1013DEL %TMPDIR%\ov2.out
1014@echo on
1015@echo Testing...
1016%PNAME% -i arc -f reference\google.arc -o tomtom -F %TMPDIR%\ov2.out
1017@echo off
1018@echo.
1019CALL :COMPARE %TMPDIR%\ov2.out reference\ov2-arc-out.ref
1020
1021DEL %TMPDIR%\ov2.out
1022@echo on
1023@echo Testing...
1024%PNAME% -i geo -f reference\gl.loc -o tomtom -F %TMPDIR%\ov2.out
1025@echo off
1026@echo.
1027CALL :COMPARE %TMPDIR%\ov2.out reference\ov2-geo-out.ref
1028
1029DEL %TMPDIR%\ov2.out
1030@echo on
1031@echo Testing...
1032%PNAME% -i tomtom -f reference\ov2-geo-out.ref -o gpsutil -F %TMPDIR%\ov2.out
1033@echo off
1034@echo.
1035CALL :COMPARE %TMPDIR%\ov2.out reference\ov2-in.ref
1036
1037REM
1038REM XCSV "human readable" tests
1039REM
1040DEL %TMPDIR%\humanread.out
1041@echo on
1042@echo Testing...
1043%PNAME% -i xcsv,style=reference\humanread.style -f reference\human.in -o arc -F %TMPDIR%\humanread.out
1044@echo off
1045@echo.
1046CALL :COMPARE %TMPDIR%\humanread.out reference\humanread.out
1047
1048DEL %TMPDIR%\humanwrite.out
1049@echo on
1050@echo Testing...
1051%PNAME% -i xcsv,style=reference\humanread.style -f reference\human.in -o xcsv,style=reference\humanwrite.style -F %TMPDIR%\humanwrite.out
1052@echo off
1053@echo.
1054CALL :COMPARE %TMPDIR%\humanwrite.out reference\humanwrite.out
1055
1056REM
1057REM XCSV "path distance" test
1058REM
1059DEL %TMPDIR%\pathdist.out
1060@echo on
1061@echo Testing...
1062%PNAME% -i magellan -f reference\dusky.trk -o xcsv,style=reference\gnuplot.style -F %TMPDIR%\pathdist.out
1063@echo off
1064@echo.
1065CALL :COMPARE %TMPDIR%\pathdist.out reference\dusky.gnuplot
1066
1067REM hsandv
1068DEL %TMPDIR%\hsandv.exp %TMPDIR%\1.exp %TMPDIR%\1.exp %TMPDIR%\Glad_5.exp
1069@echo on
1070@echo Testing...
1071%PNAME% -i geo -f geocaching.loc -o hsandv -F %TMPDIR%\hsandv.exp
1072@echo off
1073@echo.
1074CALL :COMPARE %TMPDIR%\hsandv.exp reference
1075REM the hsandv format is too lossy to do this test :(
1076REM ${PNAME} -i hsandv -f ${TMPDIR}/hsandv.exp -o geo -F ${TMPDIR}/1.exp
1077REM ${PNAME} -i hsandv -f reference/hsandv.exp -o geo -F ${TMPDIR}/2.exp
1078REM compare ${TMPDIR}/1.exp ${TMPDIR}/2.exp
1079REM test conversion from v4 to v5 files
1080@echo on
1081@echo Testing...
1082%PNAME% -i hsandv -f reference\Glad_4.exp -o hsandv -F %TMPDIR%\Glad_5.exp
1083@echo off
1084@echo.
1085REM FIXME: Can't compare directly because of potential FP rounding.
1086REM FIXME: compare ${TMPDIR}/Glad_5.exp reference
1087
1088REM
1089REM stack filter tests
1090REM These don't actually test for proper behavior, for now, but they do
1091REM exercise all of the currently-extant filter code.
1092REM
1093
1094@echo on
1095@echo Testing...
1096%PNAME% -i geo -f geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o arc -F %TMPDIR%\stackfilt.txt
1097@echo off
1098@echo.
1099
1100REM
1101REM 'tabsep' isn't really tested in any non-trivial way, but we do exercise
1102REM it.
1103REM
1104
1105@echo on
1106@echo Testing...
1107%PNAME% -i geo -f geocaching.loc  -o tabsep -F %TMPDIR%\tabsep.in
1108%PNAME% -i tabsep -f %TMPDIR%\tabsep.in -o geo -F %TMPDIR%\tabsep.out
1109%PNAME% -i geo -f geocaching.loc  -o geo -F %TMPDIR%\geotabsep.out
1110@echo off
1111@echo.
1112CALL :COMPARE %TMPDIR%\tabsep.out %TMPDIR%\geotabsep.out
1113
1114REM
1115REM Now do the same for custom - it has the same issues.
1116REM
1117
1118@echo on
1119@echo Testing...
1120%PNAME% -i geo -f geocaching.loc  -o custom -F %TMPDIR%\custom.in
1121%PNAME% -i custom -f %TMPDIR%\custom.in -o geo -F %TMPDIR%\custom.out
1122%PNAME% -i geo -f geocaching.loc  -o geo -F %TMPDIR%\geocustom.out
1123@echo off
1124@echo.
1125
1126REM
1127REM Write something to the various output-only formats
1128REM
1129@echo on
1130@echo Testing...
1131%PNAME% -i geo -f 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
1132@echo off
1133@echo.
1134
1135REM
1136REM tef "TourExchangeFormat" read test
1137REM
1138DEL %TMPDIR%\tef_xml*
1139@echo on
1140@echo Testing...
1141%PNAME% -r -i tef -f reference\route\tef_xml.sample.xml -o gpx -F %TMPDIR%\tef_xml.sample.gpx
1142@echo off
1143@echo.
1144CALL :COMPARE %TMPDIR%\tef_xml.sample.gpx reference\route\tef_xml.sample.gpx
1145
1146REM
1147REM PathAway Palm Database .pdb tests
1148REM
1149DEL %TMPDIR%\pathaway*
1150@echo on
1151@echo Testing...
1152%PNAME% -i geo -f geocaching.loc -o pathaway,dbname=pathaway-geo -F %TMPDIR%\pathaway-geo.pdb
1153%PNAME% -i pathaway -f %TMPDIR%\pathaway-geo.pdb -o geo -F %TMPDIR%\pathaway-geo.loc
1154@echo off
1155@echo.
1156CALL :COMPARE %TMPDIR%\pathaway-geo.loc reference\pathaway-geo.loc
1157DEL %TMPDIR%\pathaway*
1158@echo on
1159@echo Testing...
1160%PNAME% -t -i pathaway -f reference\track\pathaway.pdb -o gpx -F %TMPDIR%\pathaway.gpx
1161@echo off
1162@echo.
1163CALL :COMPARE %TMPDIR%\pathaway.gpx reference\track\pathaway.gpx
1164
1165REM
1166REM Garmin GPS Database .gdb tests
1167REM
1168DEL %TMPDIR%\gdb-*
1169@echo on
1170@echo Testing...
1171%PNAME% -i gdb,via -f reference\gdb-sample.gdb -o gpx -F %TMPDIR%\gdb-sample.gpx
1172@echo off
1173@echo.
1174CALL :COMPARE reference\gdb-sample.gpx %TMPDIR%\gdb-sample.gpx
1175@echo on
1176@echo Testing...
1177%PNAME% -i gpx -f reference\gdb-sample.gpx -o gdb,ver=1 -F %TMPDIR%\gdb-sample.gdb
1178%PNAME% -i gdb -f %TMPDIR%\gdb-sample.gdb -o gpx -F %TMPDIR%\gdb-sample.gpx
1179@echo off
1180@echo.
1181REM
1182REM Because of Garmin coordinates storage gpx is not good for this test
1183REM compare reference/gdb-sample.gpx ${TMPDIR}/gdb-sample.gpx
1184REM
1185REM compare ${TMPDIR}/gdb-sample.gpx reference/gdb-sample.gpx
1186
1187REM
1188REM Vito Navigator II .smt tests
1189REM
1190DEL %TMPDIR%\vitosmt*
1191@echo on
1192@echo Testing...
1193%PNAME%    -i vitosmt -f reference\vitosmt.smt -o gpx -F %TMPDIR%\vitosmt.gpx
1194@echo off
1195@echo.
1196CALL :COMPARE %TMPDIR%\vitosmt.gpx reference\vitosmt.gpx
1197@echo on
1198@echo Testing...
1199%PNAME% -t -i vitosmt -f reference\vitosmt.smt -o gpx -F %TMPDIR%\vitosmt_t.gpx
1200@echo off
1201@echo.
1202CALL :COMPARE %TMPDIR%\vitosmt_t.gpx reference\track\vitosmt_t.gpx
1203
1204REM
1205REM tracks filter tests
1206REM
1207
1208DEL %TMPDIR%\trackfilter*
1209
1210@echo on
1211@echo Testing...
1212%PNAME% -t -i gpx -f reference\track\trackfilter.gpx -x track,pack,split,title=LOG-%%Y%%m%%d -o gpx -F %TMPDIR%\trackfilter.gpx
1213@echo off
1214@echo.
1215CALL :COMPARE %TMPDIR%\trackfilter.gpx reference\track\trackfilter.gpx
1216
1217REM
1218REM Map&Guide Motorrad Routenplaner .bcr files test
1219REM
1220DEL %TMPDIR%\bcr*
1221@echo on
1222@echo Testing...
1223%PNAME% -r -i bcr -f reference\route\bcr-sample.bcr -o gpx -F %TMPDIR%\bcr-sample.gpx
1224@echo off
1225@echo.
1226CALL :COMPARE %TMPDIR%\bcr-sample.gpx reference\route\bcr-sample.gpx
1227@echo on
1228@echo Testing...
1229%PNAME% -r -i gpx -f reference\route\bcr-sample.gpx -o bcr -F %TMPDIR%\bcr-sample2.bcr
1230@echo off
1231@echo.
1232CALL :COMPARE reference\route\bcr-sample2.bcr %TMPDIR%\bcr-sample2.bcr
1233@echo on
1234@echo Testing...
1235%PNAME% -r -i bcr -f %TMPDIR%\bcr-sample2.bcr -o gpx -F %TMPDIR%\bcr-sample2.gpx
1236@echo off
1237@echo.
1238
1239REM
1240REM cet - Character encoding transformation tests
1241REM
1242DEL %TMPDIR%\cet-sample*
1243@echo on
1244@echo Testing...
1245%PNAME% -w -i gdb -f reference\cet\cet-sample.gdb -o gpx -F %TMPDIR%\cet-sample.gpx
1246@echo off
1247@echo.
1248CALL :COMPARE %TMPDIR%\cet-sample.gpx reference\cet\cet-sample.gpx
1249@echo on
1250@echo Testing...
1251%PNAME% -w -i gpx -f %TMPDIR%\cet-sample.gpx -o tmpro -c Latin1 -F %TMPDIR%\cet-sample.latin1.txt
1252@echo off
1253@echo.
1254CALL :COMPARE %TMPDIR%\cet-sample.latin1.txt reference\cet\cet-sample.latin1.txt
1255@echo on
1256@echo Testing...
1257%PNAME% -w -i gdb -f reference\cet\cet-sample.gdb -o tmpro -c Latin2 -F %TMPDIR%\cet-sample.latin2.txt
1258@echo off
1259@echo.
1260CALL :COMPARE %TMPDIR%\cet-sample.latin2.txt reference\cet\cet-sample.latin2.txt
1261@echo on
1262@echo Testing...
1263%PNAME% -w -i gdb -f reference\cet\cet-sample.gdb -o tmpro -c cp1250 -F %TMPDIR%\cet-sample.cp1250.txt
1264@echo off
1265@echo.
1266CALL :COMPARE %TMPDIR%\cet-sample.cp1250.txt reference\cet\cet-sample.cp1250.txt
1267@echo on
1268@echo Testing...
1269%PNAME% -w -i gdb -f reference\cet\cet-sample.gdb -o tmpro -c macroman -F %TMPDIR%\cet-sample.macroman.txt
1270@echo off
1271@echo.
1272CALL :COMPARE %TMPDIR%\cet-sample.macroman.txt reference\cet\cet-sample.macroman.txt
1273
1274REM
1275REM Garmin logbook.   This format has an extra section (lap data with things
1276REM like heartbeat and calories burned) that we don't know what to do with,
1277REM so we convert it to gpx, convert it to itself, convert THAT to gpx, and
1278REM compare those.
1279REM
1280DEL %TMPDIR%\glogbook*
1281@echo on
1282@echo Testing...
1283%PNAME% -i glogbook -f reference\track\garmin_logbook.xml -o gpx -F %TMPDIR%\glog1.gpx
1284%PNAME% -i glogbook -f reference\track\garmin_logbook.xml -o glogbook -F %TMPDIR%\glog.xml
1285%PNAME% -i glogbook -f %TMPDIR%\glog.xml -o gpx -F %TMPDIR%\glog2.gpx
1286@echo off
1287@echo.
1288CALL :COMPARE %TMPDIR%\glog1.gpx %TMPDIR%\glog2.gpx
1289
1290REM
1291REM Dop filter test
1292REM
1293DEL %TMPDIR%\dop*
1294FINDSTR /V /R /C:"<hdop>50" reference\dop-test.gpx | %PNAME% -i gpx -f - -o openoffice -F - | sed 's\RPT...\\g'> %TMPDIR%\dop-hdop.ref
1295@echo on
1296@echo Testing...
1297%PNAME% -i gpx -f reference\dop-test.gpx -x discard,hdop=50 -o openoffice -F - | sed 's\RPT...\\g'> %TMPDIR%\dop-hdop.fil
1298@echo off
1299@echo.
1300CALL :COMPARE %TMPDIR%\dop-hdop.ref %TMPDIR%\dop-hdop.fil
1301FINDSTR /V /R /C:"<vdop>50" reference\dop-test.gpx | %PNAME% -i gpx -f - -o openoffice -F - | sed 's\RPT...\\g'> %TMPDIR%\dop-vdop.ref
1302@echo on
1303@echo Testing...
1304%PNAME% -i gpx -f reference\dop-test.gpx -x discard,vdop=50 -o openoffice -F - | sed 's\RPT...\\g'> %TMPDIR%\dop-vdop.fil
1305@echo off
1306@echo.
1307CALL :COMPARE %TMPDIR%\dop-vdop.ref %TMPDIR%\dop-vdop.fil
1308
1309REM
1310REM cotoGPS tests
1311REM
1312DEL %TMPDIR%\coto*
1313REM Track reading
1314@echo on
1315@echo Testing...
1316%PNAME% -i coto -f reference\cototesttrack.pdb -o xcsv,style=reference\cototest.style -F %TMPDIR%\cototrack.csv
1317@echo off
1318@echo.
1319CALL :COMPARE reference\cototesttrack.csv %TMPDIR%\cototrack.csv
1320REM Marker read
1321@echo on
1322@echo Testing...
1323%PNAME% -i coto -f reference\cototestmarker.pdb -o gpx -F %TMPDIR%\cotomarker.gpx
1324@echo off
1325@echo.
1326CALL :COMPARE reference\cototestmarker.gpx %TMPDIR%\cotomarker.gpx
1327REM Marker write
1328@echo on
1329@echo Testing...
1330%PNAME% -i gpx -f reference\cototestmarker.gpx -o coto -F %TMPDIR%\cotomarker.pdb
1331@echo off
1332@echo.
1333REM bincompare reference/cototestmarker.pdb ${TMPDIR}/cotomarker.pdb
1334@echo on
1335@echo Testing...
1336%PNAME% -i coto -f %TMPDIR%\cotomarker.pdb -o gpx -F %TMPDIR%\cotomarker.gpx
1337@echo off
1338@echo.
1339CALL :COMPARE reference\cototestmarker.gpx %TMPDIR%\cotomarker.gpx
1340
1341REM
1342REM Fugawi test cases
1343DEL %TMPDIR%\fugawi*
1344@echo on
1345@echo Testing...
1346%PNAME%  -i fugawi -f reference\fugawi.notime.txt -o fugawi -F %TMPDIR%\fugawi1.txt
1347@echo off
1348@echo.
1349CALL :COMPARE reference\fugawi.ref.txt %TMPDIR%\fugawi1.txt
1350@echo on
1351@echo Testing...
1352%PNAME%  -i geo -f geocaching.loc -o fugawi -F %TMPDIR%\fugawi2.txt
1353@echo off
1354@echo.
1355CALL :COMPARE reference\fugawi.ref.txt %TMPDIR%\fugawi2.txt
1356@echo on
1357@echo Testing...
1358%PNAME%  -i fugawi -f %TMPDIR%\fugawi2.txt -o fugawi -F %TMPDIR%\fugawi3.txt
1359@echo off
1360@echo.
1361CALL :COMPARE %TMPDIR%\fugawi2.txt %TMPDIR%\fugawi3.txt
1362@echo on
1363@echo Testing...
1364%PNAME%  -i fugawi -f reference\fugawi.time.txt  -o fugawi -F %TMPDIR%\fugawi4.txt
1365@echo off
1366@echo.
1367CALL :COMPARE reference\fugawi.time.ref.txt %TMPDIR%\fugawi4.txt
1368@echo on
1369@echo Testing...
1370%PNAME% -i gpx -f reference\track\tracks.gpx  -o fugawi -F %TMPDIR%\fugawi5.txt
1371@echo off
1372@echo.
1373CALL :COMPARE reference\track\fugawi.txt %TMPDIR%\fugawi5.txt
1374
1375REM
1376REM Magellan Explorist geocaching format (write-only).
1377REM
1378@echo on
1379@echo Testing...
1380%PNAME% -i gpx -f reference\gc\GC7FA4.gpx -f reference\gc\GCGCA8.gpx -o maggeo -F %TMPDIR%\maggeo.gs
1381@echo off
1382@echo.
1383CALL :COMPARE reference\gc\maggeo.gs %TMPDIR%\maggeo.gs
1384
1385REM
1386REM IGN Rando tests
1387REM
1388@echo on
1389@echo Testing...
1390%PNAME% -i ignrando -f reference\track\ignrando-sample.rdn -o ignrando -F %TMPDIR%\ignrando-sample.rdn
1391%PNAME% -i ignrando -f %TMPDIR%\ignrando-sample.rdn -o gpx -F %TMPDIR%\ignrando-sample.gpx
1392@echo off
1393@echo.
1394CALL :COMPARE %TMPDIR%\ignrando-sample.gpx reference\track\ignrando-sample.gpx
1395
1396REM
1397REM STMwpp "Suunto Trek Manager" WaypointPlus format tests
1398REM
1399DEL %TMPDIR%\stmwpp-*
1400@echo on
1401@echo Testing...
1402%PNAME% -i stmwpp -f reference\track\stmwpp-track.txt -o gpx -F %TMPDIR%\stmwpp-track.gpx
1403@echo off
1404@echo.
1405CALL :COMPARE %TMPDIR%\stmwpp-track.gpx reference\track\stmwpp-track.gpx
1406@echo on
1407@echo Testing...
1408%PNAME% -i stmwpp -f reference\route\stmwpp-route.txt -o gpx -F %TMPDIR%\stmwpp-route.gpx
1409@echo off
1410@echo.
1411CALL :COMPARE %TMPDIR%\stmwpp-route.gpx reference\route\stmwpp-route.gpx
1412@echo on
1413@echo Testing...
1414%PNAME% -i stmwpp -f reference\route\stmwpp-route.txt -o stmwpp -F %TMPDIR%\stmwpp-route.txt
1415@echo off
1416@echo.
1417CALL :COMPARE %TMPDIR%\stmwpp-route.txt reference\route\stmwpp-route.txt
1418
1419REM
1420REM Microsoft AutoRoute 2002 test (read-only)
1421REM
1422@echo on
1423@echo Testing...
1424%PNAME% -i msroute -f reference\route\msroute-sample.axe -o gpx -F %TMPDIR%\msroute-sample.gpx
1425@echo off
1426@echo.
1427CALL :COMPARE %TMPDIR%\msroute-sample.gpx reference\route\msroute-sample.gpx
1428
1429REM
1430REM CarteSurTable read test
1431REM
1432DEL %TMPDIR%\cst-*
1433@echo on
1434@echo Testing...
1435%PNAME% -i cst -f reference\route\cst-sample.cst -o gpx -F %TMPDIR%\cst-sample.gpx
1436@echo off
1437@echo.
1438CALL :COMPARE %TMPDIR%\cst-sample.gpx reference\route\cst-sample.gpx
1439
1440REM
1441REM Navigon Mobile Navigator .rte tests
1442REM
1443DEL %TMPDIR%\nmn4-sample*
1444@echo on
1445@echo Testing...
1446%PNAME% -i nmn4 -f reference\route\nmn4-sample.rte -o gpx -F %TMPDIR%\nmn4-sample.gpx
1447@echo off
1448@echo.
1449CALL :COMPARE reference\route\nmn4-sample.gpx %TMPDIR%\nmn4-sample.gpx
1450@echo on
1451@echo Testing...
1452%PNAME% -i gpx -f reference\route\nmn4-sample.gpx -o nmn4 -F %TMPDIR%\nmn4-sample-out.rte
1453@echo off
1454@echo.
1455CALL :COMPARE reference\route\nmn4-sample-out.rte %TMPDIR%\nmn4-sample-out.rte
1456
1457REM
1458REM Map&Guide Palm/OS .pdb files (read-only)
1459REM
1460DEL %TMPDIR%\mag_pdb-*
1461@echo on
1462@echo Testing...
1463%PNAME% -i mag_pdb -f reference\route\mag_pdb-sample.pdb -o gpx -F %TMPDIR%\mag_pdb-sample.gpx
1464@echo off
1465@echo.
1466CALL :COMPARE %TMPDIR%\mag_pdb-sample.gpx reference\route\mag_pdb-sample.gpx
1467
1468REM
1469REM CompeGPS I/O tests
1470REM
1471DEL %TMPDIR%\compegps*
1472REM read (CompeGPS)
1473@echo on
1474@echo Testing...
1475%PNAME% -i compegps -f reference\compegps.wpt -o gpx -F %TMPDIR%\compegps-wpt.gpx
1476@echo off
1477@echo.
1478CALL :COMPARE reference\compegps-wpt.gpx %TMPDIR%\compegps-wpt.gpx
1479@echo on
1480@echo Testing...
1481%PNAME% -i compegps -f reference\route\compegps.rte -o gpx -F %TMPDIR%\compegps-rte.gpx
1482@echo off
1483@echo.
1484CALL :COMPARE reference\route\compegps-rte.gpx %TMPDIR%\compegps-rte.gpx
1485@echo on
1486@echo Testing...
1487%PNAME% -i compegps -f reference\track\compegps.trk -o gpx -F %TMPDIR%\compegps-trk.gpx
1488@echo off
1489@echo.
1490CALL :COMPARE reference\track\compegps-trk.gpx %TMPDIR%\compegps-trk.gpx
1491REM write (CompeGPS)
1492@echo on
1493@echo Testing...
1494%PNAME% -i compegps -f reference\compegps.wpt -o compegps -F %TMPDIR%\compegps.wpt
1495%PNAME% -i compegps -f %TMPDIR%\compegps.wpt -o gpx -F %TMPDIR%\compegps-wpt2.gpx
1496@echo off
1497@echo.
1498CALL :COMPARE reference\compegps-wpt.gpx %TMPDIR%\compegps-wpt2.gpx
1499@echo on
1500@echo Testing...
1501%PNAME% -t -i compegps -f reference\track\compegps.trk -o compegps -F %TMPDIR%\compegps.trk
1502%PNAME% -i compegps -f %TMPDIR%\compegps.trk -o gpx -F %TMPDIR%\compegps-trk2.gpx
1503@echo off
1504@echo.
1505CALL :COMPARE reference\track\compegps-trk.gpx %TMPDIR%\compegps-trk2.gpx
1506@echo on
1507@echo Testing...
1508%PNAME% -r -i compegps -f reference\route\compegps.rte -o compegps -F %TMPDIR%\compegps.rte
1509%PNAME% -i compegps -f %TMPDIR%\compegps.rte -o gpx -F %TMPDIR%\compegps-rte2.gpx
1510@echo off
1511@echo.
1512CALL :COMPARE reference\route\compegps-rte.gpx %TMPDIR%\compegps-rte2.gpx
1513
1514REM
1515REM Testing the 'nuketypes' filter is funky.
1516REM Convert a GPX file to GPX to eliminate jitter.
1517REM Then nuke the all but the three individual types, merge the result together
1518REM and verify we got the original back.
1519REM
1520@echo on
1521@echo Testing...
1522%PNAME% -i gpx -f reference\gdb-sample.gpx -o gpx -F %TMPDIR%\alltypes.gpx
1523%PNAME% -i gpx -f %TMPDIR%\alltypes.gpx -x nuketypes,tracks,routes -o gpx -F %TMPDIR%\wpts.gpx
1524%PNAME% -i gpx -f %TMPDIR%\alltypes.gpx -x nuketypes,waypoints,routes -o gpx -F %TMPDIR%\trks.gpx
1525%PNAME% -i gpx -f %TMPDIR%\alltypes.gpx -x nuketypes,waypoints,tracks -o gpx -F %TMPDIR%\rtes.gpx
1526%PNAME% -i gpx -f %TMPDIR%\wpts.gpx -f %TMPDIR%\trks.gpx -f %TMPDIR%\rtes.gpx -o gpx -F %TMPDIR%\merged.gpx
1527@echo off
1528@echo.
1529CALL :COMPARE %TMPDIR%\alltypes.gpx %TMPDIR%\merged.gpx
1530
1531REM
1532REM Interpolate filter
1533REM
1534
1535@echo on
1536@echo Testing...
1537%PNAME% -i gpx -f reference\track\simpletrack.gpx -x interpolate,distance=50m -o gpx -F %TMPDIR%\interp.gpx
1538@echo off
1539@echo.
1540CALL :COMPARE reference\track\interptrack.gpx %TMPDIR%\interp.gpx
1541@echo on
1542@echo Testing...
1543%PNAME% -i gpx -f reference\track\simpletrack.gpx -x interpolate,time=1 -o gpx -F %TMPDIR%\tinterp.gpx
1544@echo off
1545@echo.
1546CALL :COMPARE reference\track\tinterptrack.gpx %TMPDIR%\tinterp.gpx
1547
1548REM
1549REM Universal CSV - unicsv
1550REM
1551ECHO lat,lon,descr,name,notes,unk,unk> %TMPDIR%\unicsv.txt
1552TYPE reference\mxf.mxf>> %TMPDIR%\unicsv.txt
1553@echo on
1554@echo Testing...
1555%PNAME% -i unicsv -f %TMPDIR%\unicsv.txt -o gpx -F %TMPDIR%\unicsv.gpx
1556@echo off
1557@echo.
1558CALL :COMPARE %TMPDIR%\unicsv.gpx reference\unicsv.gpx
1559
1560REM
1561REM Basic NMEA tests
1562REM
1563@echo on
1564@echo Testing...
1565%PNAME% -i nmea -f reference\track\nmea -o gpx -F %TMPDIR%\nmea.gpx
1566@echo off
1567@echo.
1568CALL :COMPARE %TMPDIR%\nmea.gpx reference\track\nmea.gpx
1569
1570REM
1571REM Wfff.
1572REM
1573@echo on
1574@echo Testing...
1575%PNAME% -i wfff -f reference\wfff.xml -o gpsutil -F %TMPDIR%\wfff.gpu
1576@echo off
1577@echo.
1578CALL :COMPARE %TMPDIR%\wfff.gpu reference\wfff.gpu
1579
1580REM
1581REM Garmin MapSource tab delimited text files - garmin_txt
1582REM
1583DEL %TMPDIR%\garmin_txt*
1584REM
1585REM !!! garmin_txt timestamps are stored in localtime !!!
1586REM
1587@echo on
1588@echo Testing...
1589%PNAME% -i gdb -f reference\gdb-sample2.gdb -o garmin_txt,utc,prec=9 -F %TMPDIR%\garmin_txt.txt
1590@echo off
1591@echo.
1592CALL :COMPARE reference\garmin_txt.txt %TMPDIR%\garmin_txt.txt
1593@echo on
1594@echo Testing...
1595%PNAME% -i garmin_txt -f reference\garmin_txt.txt -o garmin_txt,prec=9 -F %TMPDIR%\garmin_txt-2.txt
1596%PNAME% -i garmin_txt -f %TMPDIR%\garmin_txt-2.txt -o garmin_txt,prec=9 -F %TMPDIR%\garmin_txt-3.txt
1597@echo off
1598@echo.
1599CALL :COMPARE %TMPDIR%\garmin_txt-2.txt %TMPDIR%\garmin_txt-3.txt
1600
1601