summaryrefslogtreecommitdiff
path: root/decoder/runtc.c
AgeCommit message (Collapse)Author
2022-04-23runtc: add support for input file formats other than native srzipGerhard Sittig
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.
2022-04-23runtc: cope with "late" samplerate announcementGerhard Sittig
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.
2022-04-23runtc: avoid the 'class' identifier in C language application codeGerhard Sittig
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.
2021-12-26runtc: optionally send EOF to decoder sessionGerhard Sittig
Communicate EOF to the decoder session (when the library supports it).
2018-05-12runtc: print errors at more failure pointsfenugrec
run_testcase() can fail in many ways and just cause runtc to return 1, at least now it doesn't do so silently.
2017-06-06Add support for initial pin settings.Uwe Hermann
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).
2017-02-27runtc: unbreak the protocol decoder output match logic (type vs instance)Gerhard Sittig
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.
2017-02-27runtc: fixup coding style (conditionals, braces)Gerhard Sittig
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.
2017-02-27runtc: minor nits in main()Gerhard Sittig
Pass NULL instead of 0 where a pointer is expected. Fixup whitespace.
2017-02-27runtc: minor nits in usage(), add missing optionsGerhard Sittig
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.
2017-02-20Use PD ID (not PD instance ID) for now.Uwe Hermann
This is related to the libsigrokdecode change regarding bug #868.
2017-02-02runtc, pdtest: Fixup minor style nitsGerhard Sittig
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.
2015-10-16Use g_strerror() in favor of strerror().Uwe Hermann
2015-08-20Pass unitsize to srd_session_send() directly.Uwe Hermann
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.
2015-03-30Constify a few parameters.Uwe Hermann
2015-03-30Minor cosmetics.Uwe Hermann
2015-03-30Make a few variables and functions static.Uwe Hermann
2015-03-30Update due to sr_session_load() API change.Uwe Hermann
2014-11-11Use getters now that 'struct sr_dev_inst' is opaque.Uwe Hermann
2014-11-09runtc: Support loading *.sr files with unitsize != 1.Uwe Hermann
2014-10-14runtc: Add support for integer PD options.Uwe Hermann
So far only string options were supported.
2014-09-15Replace ann_format with ann_class.Uwe Hermann
The naming has been changed to "annotation class" a while ago.
2014-09-01Add initial set of PD tests.Uwe Hermann
This is a slightly modified version of the PD test suite that was part of libsigrokdecode previously.