6 # ========== Executing "run-tests.pl" ==========
7 # Tests for this branch
8 ok - "../gpst -o gpx extensions.gpx" - Read and output GPX with <extensions> element
9 ok - "../gpst -o gpx extensions.gpx" - Read and output GPX with <extensions> element (stderr)
10 ok - "../gpst -w -o gpx extensions.gpx" - Read and output GPX with <extensions> element and strip whitespace
11 ok - "../gpst -w -o gpx extensions.gpx" - Read and output GPX with <extensions> element and strip whitespace (stderr)
12 not ok - "../gpst -o gpx many-extensions.gpx" - Output GPX format from GPX with many <extensions>
13 # Failed test '"../gpst -o gpx many-extensions.gpx" - Output GPX format from GPX with many <extensions>'
14 # at ./run-tests.pl line 2256.
15 # got: '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
18 # creator="gpst - http://svn.sunbase.org/repos/utils/trunk/src/gpstools/"
19 # xmlns="http://www.topografix.com/GPX/1/1"
20 # xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21 # xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
25 # <trkpt lat="21" lon="22"> <time>2001-02-03T04:05:06Z</time> <extensions> <ba>1 in trkpt</ba>
28 # <bca>bca trkpt</bca>
29 # <bcb>trkpt bcb</bcb>
32 # <bccba>bccba stuff</bccba>
35 # <bccbb>bccba thingy</bccbb>
38 # </bc> </extensions> </trkpt>
39 # <extensions> <da>trkseg 1</da>
40 # <db>trkseg 2</db> </extensions>
45 # expected: '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
48 # creator="gpst - http://svn.sunbase.org/repos/utils/trunk/src/gpstools/"
49 # xmlns="http://www.topografix.com/GPX/1/1"
50 # xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
51 # xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
54 # <name>File with <extensions> elements</name>
58 # <aa>metadata aa</aa>
60 # <mb>bb in metadata</mb>
63 # <wpt lat="11" lon="12">
64 # <name>Somewhere in Nigeria</name>
70 # <name>Track 1</name>
72 # <blurfl>inside trk</blurfl>
75 # <trkpt lat="21" lon="22">
76 # <time>2001-02-03T04:05:06Z</time>
81 # <bca>bca trkpt</bca>
82 # <bcb>trkpt bcb</bcb>
85 # <bccba>bccba stuff</bccba>
88 # <bccbb>bccba thingy</bccbb>
104 # <g>Penguin Power</g>
108 ok - "../gpst -o gpx many-extensions.gpx" - Output GPX format from GPX with many <extensions> (stderr)
109 # Testing conversion routines...
110 ok - txt_to_xml("abc")
111 ok - txt_to_xml("<&>")
112 ok - txt_to_xml() with multiline string
113 ok - xml_to_txt("abc")
114 ok - xml_to_txt("<&>")
115 ok - xml_to_txt() with multiline string
116 ok - postgresql_copy_safe() with empty string
117 ok - postgresql_copy_safe("abcæøåÆØÅ")
118 ok - postgresql_copy_safe("abc\t'\r\n")
119 ok - postgresql_copy_safe() with multiline, nulls and stuff
120 # Testing date routines...
121 ok - sec_to_string() without separator
122 ok - sec_to_string() with separator
123 ok - sec_to_string(-5000) — negative numbers unsupported atm
124 ok - sec_to_string("")
125 ok - sec_to_string() with invalid string
126 ok - sec_to_string() with a bunch of leading zeros
127 ok - sec_to_string() with decimals
128 ok - sec_to_string() with decimals and prefixing zeros
129 ok - sec_to_string() with decimals and extra trailing zeros
130 ok - sec_to_string() with missing zero before decimal point
131 ok - sec_to_readable(0)
132 ok - sec_to_readable() with invalid string
133 ok - sec_to_readable(86400)
134 ok - sec_to_readable(86400*1000)
135 ok - sec_to_readable(86400+7200+180+4)
136 ok - sec_to_readable("3.14")
137 ok - sec_to_readable() rejects negative numbers
138 ok - sec_to_readable() rejects negative decimal
139 ok - sec_to_readable(), missing zero before decimal point
140 ok - sec_to_readable() with empty string
141 # Testing geo routines...
142 ok - ddd_to_dms("12.34567")
145 ok - ddd_to_dms("pH()rtY tW0")
146 ok - ddd_to_dms("-12.34567")
147 ok - ddd_to_dms("0.34567")
148 ok - ddd_to_dms(".34567")
149 ok - ddd_to_dms("-.34567")
150 ok - ddd_to_dms("-0.34567")
151 ok - ddd_to_dms("180")
152 ok - ddd_to_dms("-180")
153 ok - ddd_to_dms("-1")
154 ok - ddd_to_dms("2-3")
155 # Testing trackpoint()...
156 ok - trackpoint() receives empty hash
157 ok - trackpoint() (gpsml)
158 ok - trackpoint() (gpx)
159 ok - trackpoint(): {'format'} with invalid value ("2d") returns undef
160 ok - trackpoint(): {'lat'} with invalid value ("2d") returns undef
161 ok - trackpoint(): {'lon'} with invalid value ("2d") returns undef
162 ok - trackpoint(): {'what'} with invalid value ("2d") returns undef
163 ok - trackpoint(): {'year'} with empty value skips time
164 ok - trackpoint(): {'year'} with invalid value ("2d") skips time
165 ok - trackpoint(): Strip prefixing zeros from {'year'}
166 ok - trackpoint(): {'year'} is negative, skip time
167 ok - trackpoint(): Decimals in {'year'}, skip time
168 ok - trackpoint(): {'month'} with empty value skips time
169 ok - trackpoint(): {'month'} with invalid value ("2d") skips time
170 ok - trackpoint(): Strip prefixing zeros from {'month'}
171 ok - trackpoint(): {'month'} is negative, skip time
172 ok - trackpoint(): Decimals in {'month'}, skip time
173 ok - trackpoint(): {'day'} with empty value skips time
174 ok - trackpoint(): {'day'} with invalid value ("2d") skips time
175 ok - trackpoint(): Strip prefixing zeros from {'day'}
176 ok - trackpoint(): {'day'} is negative, skip time
177 ok - trackpoint(): Decimals in {'day'}, skip time
178 ok - trackpoint(): {'hour'} with empty value skips time
179 ok - trackpoint(): {'hour'} with invalid value ("2d") skips time
180 ok - trackpoint(): Strip prefixing zeros from {'hour'}
181 ok - trackpoint(): {'hour'} is negative, skip time
182 ok - trackpoint(): Decimals in {'hour'}, skip time
183 ok - trackpoint(): {'min'} with empty value skips time
184 ok - trackpoint(): {'min'} with invalid value ("2d") skips time
185 ok - trackpoint(): Strip prefixing zeros from {'min'}
186 ok - trackpoint(): {'min'} is negative, skip time
187 ok - trackpoint(): Decimals in {'min'}, skip time
188 ok - trackpoint(): {'sec'} with empty value skips time
189 ok - trackpoint(): {'sec'} with invalid value ("2d") skips time
190 ok - trackpoint(): Strip prefixing zeros from {'sec'}
191 ok - trackpoint(): {'sec'} is negative, skip time
192 ok - trackpoint(): Remove trailing zeros in {'sec'} decimals
193 ok - trackpoint(): Missing {'format'}, return undef
194 ok - trackpoint(): Missing {'what'}, return undef
195 ok - trackpoint(): Missing {'error'}, return undef
196 # Testing output from ../gpst
197 # Read empty input (/dev/null)...
198 ok - "../gpst </dev/null" - Read from /dev/null
199 ok - "../gpst </dev/null" - Read from /dev/null (stderr)
200 ok - "../gpst -o gpx </dev/null" - Output gpx from /dev/null
201 ok - "../gpst -o gpx </dev/null" - Output gpx from /dev/null (stderr)
202 # Read empty files...
203 ok - "echo '<tp> </tp>' | ../gpst" - Don’t print empty trackpoints
204 ok - "echo '<tp> </tp>' | ../gpst" - Don’t print empty trackpoints (stderr)
205 # Testing --chronology option...
206 ok - "../gpst --chronology chronology-error.gpsml" - Check for chronology errors and duplicated times
207 ok - "../gpst --chronology chronology-error.gpsml" - Check for chronology errors and duplicated times (stderr)
208 # Testing --skip-dups option...
209 ok - "../gpst -d no_signal.mayko" - Remove duplicated positions from gpsml
210 ok - "../gpst -d no_signal.mayko" - Remove duplicated positions from gpsml (stderr)
211 ok - "../gpst -d -o csv no_signal.mayko" - Remove duplicated positions from csv output format
212 ok - "../gpst -d -o csv no_signal.mayko" - Remove duplicated positions from csv output format (stderr)
213 ok - "../gpst -d -o clean no_signal.mayko" - Remove duplicated positions from clean output format
214 ok - "../gpst -d -o clean no_signal.mayko" - Remove duplicated positions from clean output format (stderr)
215 ok - "../gpst -d -o pgtab no_signal.mayko" - Remove duplicated positions from pgtab output format
216 ok - "../gpst -d -o pgtab no_signal.mayko" - Remove duplicated positions from pgtab output format (stderr)
217 # Testing --epoch option...
218 ok - "../gpst -e pause.gpx" - --epoch is ignored in gpsml output
219 ok - "../gpst -e pause.gpx" - --epoch is ignored in gpsml output (stderr)
220 ok - "../gpst -e -o gpx pause-noname.gpx" - --epoch is ignored in gpx output
221 ok - "../gpst -e -o gpx pause-noname.gpx" - --epoch is ignored in gpx output (stderr)
222 # Testing --fix option...
223 ok - "../gpst --fix --chronology chronology-error.gpsml" - Remove bad timestamps
224 ok - "../gpst --fix --chronology chronology-error.gpsml" - Remove bad timestamps (stderr)
225 # Testing --from-date option...
226 # Testing -h (--help) option...
227 ok - "../gpst -h" - Option -h prints help screen
228 ok - "../gpst -h" - Option -h prints help screen (stderr)
229 ok - "../gpst -h" - No Id with only -h
230 # Testing --inside option...
231 ok - "../gpst --pos1 2.11,2.12 --pos2 3.31,3.32 --inside multitrack-pause.gpx" - Check --inside option (gpx to gpst)
232 ok - "../gpst --pos1 2.11,2.12 --pos2 3.31,3.32 --inside multitrack-pause.gpx" - Check --inside option (gpx to gpst) (stderr)
233 # Testing --undefined option...
234 # Testing --near option...
235 # Testing --output option...
236 ok - "../gpst log.mcsv" - Read Mapsource TAB-separated format
237 ok - "../gpst log.mcsv" - Read Mapsource TAB-separated format (stderr)
238 ok - "../gpst two-digit_year.mcsv" - Read Mapsource TAB-separated format with two-digit year
239 ok - "../gpst two-digit_year.mcsv" - Read Mapsource TAB-separated format with two-digit year (stderr)
240 ok - "../gpst log.gpstxt" - Read Garmin serial text format
241 ok - "../gpst log.gpstxt" - Read Garmin serial text format (stderr)
242 ok - "../gpst log.dos.mayko" - Read DOS-formatted Mayko format
243 ok - "../gpst log.dos.mayko" - Read DOS-formatted Mayko format (stderr)
244 ok - "../gpst log.dos.gpstxt" - Read DOS-formatted Garmin serial text format
245 ok - "../gpst log.dos.gpstxt" - Read DOS-formatted Garmin serial text format (stderr)
246 ok - "../gpst log.unix.mcsv" - Read UNIX-formatted Garmin Mapsource TAB-separated format
247 ok - "../gpst log.unix.mcsv" - Read UNIX-formatted Garmin Mapsource TAB-separated format (stderr)
248 ok - "../gpst multitrack.gpx" - Read GPX file with multiple tracks
249 ok - "../gpst multitrack.gpx" - Read GPX file with multiple tracks (stderr)
250 ok - "../gpst compact.gpx" - Read GPX one-liner
251 ok - "../gpst compact.gpx" - Read GPX one-liner (stderr)
252 ok - "../gpst missing.gpsml" - Read gpsml with various data missing
253 ok - "../gpst missing.gpsml" - Read gpsml with various data missing (stderr)
254 ok - "../gpst different_dateformats.gpsml" - Read different date formats from gpsml file
255 ok - "../gpst different_dateformats.gpsml" - Read different date formats from gpsml file (stderr)
256 ok - "../gpst multitrack-pause.gpx" - Should be equal to multitrack-pause.gpsml
257 ok - "../gpst multitrack-pause.gpx" - Should be equal to multitrack-pause.gpsml (stderr)
258 ok - "../gpst -o gpx no_signal.mayko" - Output GPX from Mayko file with duplicates
259 ok - "../gpst -o gpx no_signal.mayko" - Output GPX from Mayko file with duplicates (stderr)
260 ok - "../gpst -o gpx comments.mayko" - Output GPX from Mayko file with commented-out lines
261 ok - "../gpst -o gpx comments.mayko" - Output GPX from Mayko file with commented-out lines (stderr)
262 ok - "../gpst -o gpx missing-noname.gpsml" - Output GPX from gpsml with missing data
263 ok - "../gpst -o gpx missing-noname.gpsml" - Output GPX from gpsml with missing data (stderr)
264 ok - "../gpst -o xgraph multitrack.gpx" - Output xgraph format from GPX
265 ok - "../gpst -o xgraph multitrack.gpx" - Output xgraph format from GPX (stderr)
266 ok - "../gpst -o pgtab compact.gpx" - Output pgtab from gpx format
267 ok - "../gpst -o pgtab compact.gpx" - Output pgtab from gpx format (stderr)
268 ok - "../gpst -o pgtab no_signal.mayko" - Output pgtab from mayko format
269 ok - "../gpst -o pgtab no_signal.mayko" - Output pgtab from mayko format (stderr)
270 ok - "../gpst -o pgtab missing.gpsml" - Output pgtab from missing.gpsml
271 ok - "../gpst -o pgtab missing.gpsml" - Output pgtab from missing.gpsml (stderr)
272 ok - "../gpst -o csv log.dos.mayko" - Output csv from DOS-formatted Mayko format
273 ok - "../gpst -o csv log.dos.mayko" - Output csv from DOS-formatted Mayko format (stderr)
274 ok - "../gpst -o pgwtab multitrack.gpx" - Test pgwtab format
275 ok - "../gpst -o pgwtab multitrack.gpx" - Test pgwtab format (stderr)
276 ok - "../gpst -o pgwupd multitrack.gpx" - Test pgwupd format
277 ok - "../gpst -o pgwupd multitrack.gpx" - Test pgwupd format (stderr)
278 ok - "../gpst -t -o clean pause.gpx" - Output clean format with time breaks
279 ok - "../gpst -t -o clean pause.gpx" - Output clean format with time breaks (stderr)
280 # Testing --outside option...
281 ok - "../gpst --pos1 2.11,2.12 --pos2 3.31,3.32 --outside multitrack-pause.gpx" - Check --outside option (gpx to gpst)
282 ok - "../gpst --pos1 2.11,2.12 --pos2 3.31,3.32 --outside multitrack-pause.gpx" - Check --outside option (gpx to gpst) (stderr)
283 # Testing --pos1 and --pos2 options...
284 # Testing --require option...
285 ok - "../gpst -re multitrack.gpx" - Require elevation from GPX data
286 ok - "../gpst -re multitrack.gpx" - Require elevation from GPX data (stderr)
287 ok - "../gpst -re one_ele.dos.gpsml" - Require elevation from gpsml
288 ok - "../gpst -re one_ele.dos.gpsml" - Require elevation from gpsml (stderr)
289 ok - "../gpst -re missing.gpsml" - Require elevation
290 ok - "../gpst -re missing.gpsml" - Require elevation (stderr)
291 ok - "../gpst -rt missing.gpsml" - Require time
292 ok - "../gpst -rt missing.gpsml" - Require time (stderr)
293 ok - "../gpst -rp missing.gpsml" - Require position
294 ok - "../gpst -rp missing.gpsml" - Require position (stderr)
295 ok - "../gpst -ret missing.gpsml" - Require elevation and time
296 ok - "../gpst -ret missing.gpsml" - Require elevation and time (stderr)
297 ok - "../gpst -retp missing.gpsml" - Require elevation, time and position
298 ok - "../gpst -retp missing.gpsml" - Require elevation, time and position (stderr)
299 ok - "../gpst -rep missing.gpsml" - Require elevation and position
300 ok - "../gpst -rep missing.gpsml" - Require elevation and position (stderr)
301 # Testing --round option...
302 ok - "../gpst -R lat=4,lon=5,ele=1 pause.gpx" - --round works with lat, lon, ele from gpx
303 ok - "../gpst -R lat=4,lon=5,ele=1 pause.gpx" - --round works with lat, lon, ele from gpx (stderr)
304 ok - "../gpst -R lat=3,lon=3,ele=1 -o pgtab pause.gpx" - pgtab output from gpx works with --round lat, lon, ele
305 ok - "../gpst -R lat=3,lon=3,ele=1 -o pgtab pause.gpx" - pgtab output from gpx works with --round lat, lon, ele (stderr)
306 ok - "../gpst -R lat=3,lon=3,ele=1 -o pgwtab multitrack.gpx" - --round works with lat, lon, ele from gpx, pgwtab output
307 ok - "../gpst -R lat=3,lon=3,ele=1 -o pgwtab multitrack.gpx" - --round works with lat, lon, ele from gpx, pgwtab output (stderr)
308 ok - "../gpst -R lat=3,lon=3,ele=1 -o pgwupd multitrack.gpx" - pgwupd output and --round works with lat, lon, ele from gpx
309 ok - "../gpst -R lat=3,lon=3,ele=1 -o pgwupd multitrack.gpx" - pgwupd output and --round works with lat, lon, ele from gpx (stderr)
310 # Testing --short-date option...
311 # Testing --save-to-file option...
312 # Testing --create-breaks option...
313 ok - "../gpst -t pause.gpx" - Output gpsml with <pause> elements from GPX files
314 ok - "../gpst -t pause.gpx" - Output gpsml with <pause> elements from GPX files (stderr)
315 ok - "../gpst -t multitrack-pause.gpx" - Insert <pause> between gpx tracks
316 ok - "../gpst -t multitrack-pause.gpx" - Insert <pause> between gpx tracks (stderr)
317 ok - "../gpst -t multitrack-pause.gpsml" - Insert <pause> between gpsml titles
318 ok - "../gpst -t multitrack-pause.gpsml" - Insert <pause> between gpsml titles (stderr)
319 # Testing -T (--time-shift) option...
320 ok - "../gpst -T 3600 multitrack-pause.gpx" - Add one hour to GPX input, output gpsml
321 ok - "../gpst -T 3600 multitrack-pause.gpx" - Add one hour to GPX input, output gpsml (stderr)
322 ok - "../gpst -T -3600 multitrack-pause.gpx" - Subtract one hour from GPX input, output gpsml
323 ok - "../gpst -T -3600 multitrack-pause.gpx" - Subtract one hour from GPX input, output gpsml (stderr)
324 ok - "../gpst -T 1 -o gpx multitrack-pause.gpx" - Add one second to GPX input, output GPX
325 ok - "../gpst -T 1 -o gpx multitrack-pause.gpx" - Add one second to GPX input, output GPX (stderr)
326 ok - "../gpst --time-shift -1 -o gpx multitrack-pause.gpsml" - Subtract one second from gpsml input, output GPX, use long option
327 ok - "../gpst --time-shift -1 -o gpx multitrack-pause.gpsml" - Subtract one second from gpsml input, output GPX, use long option (stderr)
328 ok - "../gpst -T 0 -o pgtab multitrack-pause.gpx" - Read GPX, time-shift 0 seconds, output pgtab
329 ok - "../gpst -T 0 -o pgtab multitrack-pause.gpx" - Read GPX, time-shift 0 seconds, output pgtab (stderr)
330 # Testing -v (--verbose) option...
331 ok - "../gpst -hv" - Option --version with -h returns Id string and help screen
332 ok - "../gpst -hv" - Option --version with -h returns Id string and help screen (stderr)
333 # Testing --version option...
334 ok - "../gpst --version" - Option --version returns Id string
335 ok - "../gpst --version" - Option --version returns Id string (stderr)
336 # Testing --strip-whitespace option...
337 ok - "../gpst -w -o gpx pause-noname.gpx" - Strip whitespace from GPX output
338 ok - "../gpst -w -o gpx pause-noname.gpx" - Strip whitespace from GPX output (stderr)
339 ok - "../gpst -o gpx -w comments.mayko" - Output whitespace-stripped GPX from Mayko file with commented-out lines
340 ok - "../gpst -o gpx -w comments.mayko" - Output whitespace-stripped GPX from Mayko file with commented-out lines (stderr)
341 ok - "../gpst -w -o pgwupd multitrack.gpx" - Strip whitespace from pgwupd output
342 ok - "../gpst -w -o pgwupd multitrack.gpx" - Strip whitespace from pgwupd output (stderr)
343 # Testing --double-y-scale option...
344 ok - "../gpst -y -o clean pause.gpx" - Double y scale, clean output from gpx format
345 ok - "../gpst -y -o clean pause.gpx" - Double y scale, clean output from gpx format (stderr)
346 ok - "../gpst -y -o clean log.dos.mayko" - Double y scale, clean output from mayko format
347 ok - "../gpst -y -o clean log.dos.mayko" - Double y scale, clean output from mayko format (stderr)
348 # Testing --debug option...
349 # Strip error from Mayko format...
350 ok - "../gpst -o csv date_error.mayko" - Strip error from mayko format in csv output
351 ok - "../gpst -o csv date_error.mayko" - Strip error from mayko format in csv output (stderr)
352 ok - "../gpst -o clean date_error.mayko" - Strip error from mayko format in clean output
353 ok - "../gpst -o clean date_error.mayko" - Strip error from mayko format in clean output (stderr)
354 ok - "../gpst -o gpsml date_error.mayko" - Strip error from mayko format in gpsml output
355 ok - "../gpst -o gpsml date_error.mayko" - Strip error from mayko format in gpsml output (stderr)
356 ok - "../gpst -o gpx date_error.mayko" - Strip error from mayko format in gpx output
357 ok - "../gpst -o gpx date_error.mayko" - Strip error from mayko format in gpx output (stderr)
358 ok - "../gpst -o gpstrans date_error.mayko" - Strip error from mayko format in gpstrans output
359 ok - "../gpst -o gpstrans date_error.mayko" - Strip error from mayko format in gpstrans output (stderr)
360 ok - "../gpst -o pgtab date_error.mayko" - Strip error from mayko format in pgtab output
361 ok - "../gpst -o pgtab date_error.mayko" - Strip error from mayko format in pgtab output (stderr)
362 ok - "../gpst -o poscount date_error.mayko" - Strip error from mayko format in poscount output
363 ok - "../gpst -o poscount date_error.mayko" - Strip error from mayko format in poscount output (stderr)
364 ok - "../gpst -o xgraph date_error.mayko" - Strip error from mayko format in xgraph output
365 ok - "../gpst -o xgraph date_error.mayko" - Strip error from mayko format in xgraph output (stderr)
366 ok - "../gpst -o ygraph date_error.mayko" - Strip error from mayko format in ygraph output
367 ok - "../gpst -o ygraph date_error.mayko" - Strip error from mayko format in ygraph output (stderr)
370 # Looks like you failed 1 test of 239.