Skip to content

Commit

Permalink
Move registerCommandsTests outside of the test_cluster.zapt partial a…
Browse files Browse the repository at this point in the history
…s it introduce some dependencies on chip-tool built-in Commands class (#10758)
  • Loading branch information
vivien-apple authored Oct 21, 2021
1 parent 995bf0e commit b6c1f11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 0 additions & 13 deletions examples/chip-tool/templates/partials/test_cluster.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,3 @@ class {{filename}}: public TestCommand
};

{{/chip_tests}}

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

commands_list clusterCommands = {
{{#chip_tests tests}}
make_unique<{{filename}}>(),
{{/chip_tests}}
};

commands.Register(clusterName, clusterCommands);
}
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,3 +5,16 @@
#include <commands/tests/TestCommand.h>

{{>test_cluster tests=(getTests)}}

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

commands_list clusterCommands = {
{{#chip_tests (getTests)}}
make_unique<{{filename}}>(),
{{/chip_tests}}
};

commands.Register(clusterName, clusterCommands);
}

0 comments on commit b6c1f11

Please sign in to comment.