Always build test programs

Building test programs on make check only is a good way to ensure they never
get updated...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Add support for comments everywhere with getline

Switch to using getline for per-line handling of input. Check each line for
a preceding comment character, then skip ahead. First line _may_ be the file
format version so we need to manually handle that with getline.

As a side-effect, this gives us support for end-of-line comments too since
we always discard what is in the buffer after our scanf ended. Plus it fixes
a bug where a mismatched input line would quietly confuse the parser.

Previously, an input line
I: 1 2 3 4 5 6\n
was parsed with fscanf("I: %04x %04x %04x %04x\n", &bustype, &vendor, &product, &version)

The next read to the file will point to "5" instead of the next line.
Treating each line independently fixes this issue, though we're still quiet
about the parsing errors.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=62272

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Benjamin Tissoires:
* Change read_* to parse_* to reflect the semantic change.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>