Uwe Hermann [Mon, 5 Jun 2017 22:09:45 +0000 (00:09 +0200)]
Add support for initial pin settings.
Adapt all tests that require it to use the old behaviour of assuming an
initial pin value of 0 (or whatever was previously hardcoded in the PD).
for now (this will likely see some changes later).
Gerhard Sittig [Sun, 26 Feb 2017 16:37:22 +0000 (17:37 +0100)]
runtc: unbreak the protocol decoder output match logic (type vs instance)
Recent libsigrokdecode adjustment changed decoder output. The ID of a
protocol decoder instance need no longer match the decoder type's name
even for simple setups.
Lookup the selected decoder's instance ID during construction of the
decoder stack. Such that the selected decoder's data can get identified
in the output of the stack which is received by runtc(1).
Note that this implementation passes the decoder type's name to the
runtc(1) output file, so that it keeps matching the expected .output
files when pdtest(1) compares those two streams. This approach avoids
the necessity to adjust test.conf or .output files. It will no longer
be appropriate when more complex test configurations shall be supported
which involve multiple instances of the same decoder type or multiple
stacks of decoders.
Gerhard Sittig [Sun, 26 Feb 2017 18:12:05 +0000 (19:12 +0100)]
runtc: fixup coding style (conditionals, braces)
When a conditional has one complex branch (multiple instructions), both
branches are supposed to have braces around them. Instead of putting
extra braces around single instructions, eliminate the "else" branch
since the "if" branch already ends in break or return respectively.
Gerhard Sittig [Sun, 26 Feb 2017 17:15:23 +0000 (18:15 +0100)]
runtc: minor nits in usage(), add missing options
Adjust the screen layout of usage() output: Align parameters to options
in identical ways, to separate them from descriptions for options which
don't take parameters. Add previously not listed options.
Gerhard Sittig [Wed, 25 Jan 2017 20:05:03 +0000 (21:05 +0100)]
runtc, pdtest: Fixup minor style nits
Address several minor style nits: Remove trailing empty lines in source
files. Declare 'static' auto variables before non-static variables.
Re-use the result of a division instead of running the calculation again.
Gerhard Sittig [Wed, 25 Jan 2017 20:09:20 +0000 (21:09 +0100)]
pdtest: Make exit code communicate the termination cause not counts
On one hand the exit(3) API might limit the range of values that can get
communicated to callers (a single byte is used in some implementations).
On the other hand wait(2) might interpret specific meaning into some of
the returned values (abnormal cause of termination, like unhandled
signals). So the use of error counts as exit codes for processes can be
severely constrained. For specific non-zero values of error counts, an
exit code of zero might be seen at the caller's side (modulo calculation
or truncation).
Don't pass error or difference counts to exit(3). Instead communicate
the kind of termination (error or difference or success) in exit codes
which reliably can get evaluated by callers.
Gerhard Sittig [Wed, 25 Jan 2017 19:57:39 +0000 (20:57 +0100)]
pdtest: Exit non-zero for errors as well as PD output differences
Make the pdtest(1) executable return a non-zero exit code for errors
during test execution (as before) as well as for differences in the
decoder output (that's the change). Return either the number of errors
seen, or the number of tests which saw different output. Only return
zero in the absence of errors and differences.