Age | Commit message (Collapse) | Author |
|
Introduce the -I command line option for the tstrun(1) utility, accept
input file format names, and options for the input module. Take single
words in multiple -I specs to simplify the internal interface between
the pdtest(1) and the tstrun(1) tools. This follows the existing pattern
for decoder options and channel assignments. The first spec is the file
format name (use 'match' for automatic detection). Subsequent specs are
input module options.
This makes all libsigrok supported input file formats available to the
sigrok-test environment, which formerly was constrained to .sr archives
only. Although the runtc(1) utility resides in the "decoder/" hierarchy,
it can both use VCD and other files to stimulate decoder tests, as well
as cover file formats and their specific features in future tests by
checking that the imported file's content is seen or that their options
take effect.
|
|
The previous implementation expected a rather specific sequence of
SR_DF_HEADER with samplerate, then SR_DF_LOGIC. This worked with .sr
formatted session files. But does not work with other input formats.
Also process SR_DF_META packets. Pass any samplerate that we learn about
to decoders' .metadata() method. Defer decoders' .start() until the first
logic samples are seen. This improves robustness of the decoder tests.
|
|
The 'class' identifier is a reserved word in the C++ language, while
development tools may combine C and C++ support and get confused. Avoid
conflicts, rename the variable to 'class_' in runtc.c source code.
|
|
Communicate EOF to the decoder session (when the library supports it).
|
|
run_testcase() can fail in many ways and just cause runtc to return 1,
at least now it doesn't do so silently.
|
|
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).
|
|
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.
|
|
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.
|
|
Pass NULL instead of 0 where a pointer is expected. Fixup whitespace.
|
|
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.
|
|
This is related to the libsigrokdecode change regarding bug #868.
|
|
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.
|
|
|
|
Follow an API change in libsigrokdecode where srd_inst_channel_set_all()
no longer gets passed a unitsize, but rather srd_session_send() gets it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
So far only string options were supported.
|
|
The naming has been changed to "annotation class" a while ago.
|
|
This is a slightly modified version of the PD test suite that was part
of libsigrokdecode previously.
|