You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

testc 1009B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. #
  3. # try to read and write all combinations we can. Don't try to
  4. # be terribly portable and don't test for correctness. This test
  5. # is meant for code coverage.
  6. #
  7. # Exercise read and write of waypoint/track/route in every format.
  8. TMPD=/tmp/babeltest.$$
  9. GB="./gpsbabel"
  10. GB="valgrind -q ./gpsbabel"
  11. mkdir $TMPD
  12. rwall() {
  13. name=$1
  14. cap=$2
  15. REFFILE=reference/expertgps.gpx
  16. if [ $(echo $cap | grep -s w) ]; then
  17. $GB -i gpx -f $REFFILE -o $name -F $TMPD/$name
  18. if [ $(echo $cap | grep -s r) ]; then
  19. $GB -i $name -f $TMPD/$name -o gpx -F /dev/null
  20. fi
  21. fi
  22. }
  23. #
  24. # Given a Geocache as input, verify we can write it.
  25. #
  26. wgc() {
  27. name=$1
  28. cap=$2
  29. REFDIR=reference/gc
  30. if [ $(echo $cap | grep -s '^.w') ]; then
  31. $GB -i gpx -f $REFDIR/GC7FA4.gpx -o $name -F $TMPD/$name-gc1
  32. $GB -i gpx -f $REFDIR/GCGCA8.gpx -o $name -F $TMPD/$name-gc2
  33. fi
  34. }
  35. $GB -^2 | while read fmt cap name junk
  36. do
  37. if [ "$fmt" != "file" ]; then
  38. continue;
  39. fi
  40. rwall $name $cap
  41. wgc $name $cap
  42. echo $name
  43. done