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
  • Loading branch information
vivien-apple committed Oct 21, 2021
1 parent c4a4361 commit 3f52235
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 @@ -190,16 +190,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 3f52235

Please sign in to comment.