summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorChristian Gagneraud <cgagneraud@techworks.ie>2012-06-02 22:44:51 +0100
committerChristian Gagneraud <chris@techworks.ie>2012-06-20 10:05:41 +0100
commit9e6cdcb27d6af143721bb27bd886fc43d1214626 (patch)
treecb2dd99743f33f021a84416deec2a6ca9da815a4 /SConstruct
parent560b34c5087843b2962a8e492a6f3da78e9b2467 (diff)
downloadgpsd-9e6cdcb27d6af143721bb27bd886fc43d1214626.tar.gz
[AIS] Add scaled and unscaled JSON dump to regression tests
The unscaled and scaled JSON dump code was not exerted with sample.aivdm, only the CSV code was. Fix that. PS: The idempotency test only validates parsing/dumping, and only in unscaled mode.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct34
1 files changed, 29 insertions, 5 deletions
diff --git a/SConstruct b/SConstruct
index 0e112e60..5c27ddf4 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1407,18 +1407,40 @@ Utility('rtcm-makeregress', [gpsdecode], [
# Regression-test the AIVDM decoder.
aivdm_regress = Utility('aivdm-regress', [gpsdecode], [
- '@echo "Testing AIVDM decoding..."',
+ '@echo "Testing AIVDM decoding w/ CSV format..."',
'for f in $SRCDIR/test/*.aivdm; do '
'echo "Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -c <$${f} >$${TMPFILE}; '
- 'diff -ub $${f}.chk $${TMPFILE}; '
+ 'diff -ub $${f}.chk $${TMPFILE} || echo "Test FAILED!"; '
+ 'rm -f $${TMPFILE}; '
+ 'done;',
+ '@echo "Testing AIVDM decoding w/ JSON unscaled format..."',
+ 'for f in $SRCDIR/test/*.aivdm; do '
+ 'echo " Testing $${f}..."; '
+ 'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
+ '$SRCDIR/gpsdecode -u -j <$${f} >$${TMPFILE}; '
+ 'diff -ub $${f}.ju.chk $${TMPFILE} || echo "Test FAILED!"; '
'rm -f $${TMPFILE}; '
'done;',
- '@echo "Testing idempotency of JSON dump/decode for AIS"',
+ '@echo "Testing AIVDM decoding w/ JSON scaled format..."',
+ 'for f in $SRCDIR/test/*.aivdm; do '
+ 'echo " Testing $${f}..."; '
+ 'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
+ '$SRCDIR/gpsdecode -j <$${f} >$${TMPFILE}; '
+ 'diff -ub $${f}.js.chk $${TMPFILE} || echo "Test FAILED!"; '
+ 'rm -f $${TMPFILE}; '
+ 'done;',
+ '@echo "Testing idempotency of unscaled JSON dump/decode for AIS"',
+ '$SRCDIR/gpsdecode -u -e -j <$SRCDIR/test/sample.aivdm.ju.chk >$${TMPFILE}; '
+ 'grep -v "^#" $SRCDIR/test/sample.aivdm.ju.chk | diff -ub - $${TMPFILE}; '
+ 'rm -f $${TMPFILE}; ',
+ # Parse the unscaled json reference, dump it as scaled json,
+ # and finally compare it with the scaled json reference
+ '@echo "Testing idempotency of scaled JSON dump/decode for AIS"',
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
- '$SRCDIR/gpsdecode -u -e -j <$SRCDIR/test/synthetic-ais.json >$${TMPFILE}; '
- 'grep -v "^#" $SRCDIR/test/synthetic-ais.json | diff -ub - $${TMPFILE}; '
+ '$SRCDIR/gpsdecode -e -j <$SRCDIR/test/sample.aivdm.ju.chk >$${TMPFILE}; '
+ 'grep -v "^#" $SRCDIR/test/sample.aivdm.js.chk | diff -ub - $${TMPFILE}; '
'rm -f $${TMPFILE}; ',
])
@@ -1426,6 +1448,8 @@ aivdm_regress = Utility('aivdm-regress', [gpsdecode], [
Utility('aivdm-makeregress', [gpsdecode], [
'for f in $SRCDIR/test/*.aivdm; do '
'$SRCDIR/gpsdecode -u -c <$${f} > $${f}.chk; '
+ '$SRCDIR/gpsdecode -u -j <$${f} > $${f}.ju.chk; '
+ '$SRCDIR/gpsdecode -j <$${f} > $${f}.js.chk; '
'done',
])