Skip to content

Commit

Permalink
[chip-tool] Add a command to list all the available tests (#12322)
Browse files Browse the repository at this point in the history
* [chip-tool] Add a command to list all the available tests

* Update generated content
  • Loading branch information
vivien-apple authored and pull[bot] committed Dec 4, 2021
1 parent 0b6d4fe commit 2657525
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/chip-tool/templates/tests-commands.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,26 @@
#include <commands/tests/TestCommand.h>
#include <commands/common/CommandInvoker.h>

class TestList : public Command
{
public:
TestList() : Command("list") {};
CHIP_ERROR Run() override
{
{{#chip_tests (getTests)}}printf("{{filename}}\n");{{/chip_tests}}

return CHIP_NO_ERROR;
}
};

{{>test_cluster tests=(getTests)}}

void registerCommandsTests(Commands & commands)
{
const char * clusterName = "Tests";

commands_list clusterCommands = {
make_unique<TestList>(),
{{#chip_tests (getTests)}}
make_unique<{{filename}}>(),
{{/chip_tests}}
Expand Down
128 changes: 128 additions & 0 deletions zzz_generated/chip-tool/zap-generated/test/Commands.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2657525

Please sign in to comment.