summaryrefslogtreecommitdiff
path: root/tools/tracing/rtla/tests/unit/timerlat_top_cli.c
AgeCommit message (Collapse)Author
2026-08-05rtla: Add unit tests for CLI with unsetTomas Glozar
Test parsing of command line that sets an option and then unsets it back to the default value in all tools. Only two CLI tests are added for each tool: short period option (-p ... --no-period) and long period option (--period ... --no-period). The logic specific for individual options is tested in opt callback tests already. Reviewed-by: Wander Lairson Costa <wander@redhat.com> Link: https://lore.kernel.org/r/20260629083654.1548925-3-tglozar@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com>
2026-05-28rtla/tests: Add unit tests for -A/--aligned optionTomas Glozar
Add both parse_args() and opt_* tests for the newly added -A/--aligned option. Assisted-by: Claude:claude-4.5-opus-high-thinking Link: https://lore.kernel.org/r/20260527144928.2944472-2-tglozar@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com>
2026-05-28rtla/tests: Add unit tests for _parse_args() functionsTomas Glozar
Add a test suite for the _parse_args() function of each tool that checks the params structures (struct common_params, struct osnoise_params, struct timerlat_params) returned by them for correctness. One test case is added per option, as well as a few special cases for tricky combinations of options. Test cases are ordered the same as the option arrays and help message to allow easy checking of whether all options are covered. This should help clarify what the proper command line behavior of RTLA is in case there are holes in the documentation and verify that the intended behavior is implemented correctly. A few necessary changes to the unit tests were done as part of this commit: - Unit tests now also link to libsubcmd and its dependencies. - A new global variable in_unit_test is added to RTLA's CLI interface, causing it to skip check for root if running in unit tests. This allows the CLI unit tests to run as non-root, like existing unit tests. There is quite a lot of duplication, some of it is mitigated with macros, but partially it is intentional so that future changes in behavior are tracked across tools. Link: https://lore.kernel.org/r/20260528103254.2990068-6-tglozar@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com>