diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-12 06:36:43 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-12 06:36:43 -0400 |
commit | 377bf4754019884bc4dec101df96042e8cdb918a (patch) | |
tree | 7eabf859c4047b7cc25ad7cffe1b15aa2f25d6f0 /test_packet.c | |
parent | 3ba253ea3df868d90b5498e980224616364057b7 (diff) | |
download | gpsd-377bf4754019884bc4dec101df96042e8cdb918a.tar.gz |
Add a driver property lister to test_packet.c.
Diffstat (limited to 'test_packet.c')
-rw-r--r-- | test_packet.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/test_packet.c b/test_packet.c index bb8bbe2c..c5335d11 100644 --- a/test_packet.c +++ b/test_packet.c @@ -324,6 +324,32 @@ static void runon_test(struct map *mp) /*@ +compdef +uniondef +usedef +formatcode @*/ } +static int property_check(void) +{ + const struct gps_type_t **dp; + + for (dp = gpsd_drivers; *dp; dp++) { + if ((*dp)->packet_type == COMMENT_PACKET) + continue; + + if (CONFIGURABLE(*dp)) + (void)fputs("config\t", stdout); + else + (void)fputs(".\t", stdout); + if ((*dp)->event_hook != NULL) + (void)fputs("hook\t", stdout); + else + (void)fputs(".\t", stdout); + if ((*dp)->packet_type > NMEA_PACKET) + (void)fputs("binary\t", stdout); + else + (void)fputs("NMEA\t", stdout); + (void)puts((*dp)->type_name); + } + + return EXIT_SUCCESS; +} + int main(int argc, char *argv[]) { struct map *mp; @@ -331,8 +357,10 @@ int main(int argc, char *argv[]) int option, singletest = 0; verbose = 0; - while ((option = getopt(argc, argv, "e:t:v:")) != -1) { + while ((option = getopt(argc, argv, "ce:t:v:")) != -1) { switch (option) { + case 'c': + exit(property_check()); case 'e': mp = singletests + atoi(optarg) - 1; (void)fwrite(mp->test, mp->testlen, sizeof(char), stdout); |