| {{> header}} |
| |
| #pragma once |
| |
| #if CONFIG_ENABLE_YAML_TESTS |
| |
| #include <app/util/af-enums.h> |
| #include <commands/tests/TestCommandBridge.h> |
| #include <lib/core/Optional.h> |
| #include <system/SystemClock.h> |
| |
| #include <math.h> // For INFINITY |
| |
| typedef void (^ResponseHandler)(id _Nullable value, NSError * _Nullable error); |
| |
| class TestList : public Command |
| { |
| public: |
| TestList() : Command("list") {}; |
| CHIP_ERROR Run() override |
| { |
| {{#chip_tests "ciTests.json" includeAllClusters=true}}printf("{{filename}}\n");{{/chip_tests}} |
| |
| return CHIP_NO_ERROR; |
| } |
| }; |
| |
| class ManualTestList : public Command |
| { |
| public: |
| ManualTestList() : Command("list-manual") {}; |
| CHIP_ERROR Run() override |
| { |
| {{#chip_tests "manualTests.json" includeAllClusters=true}}printf("{{filename}}\n");{{/chip_tests}} |
| |
| return CHIP_NO_ERROR; |
| } |
| }; |
| |
| {{>test_cluster tests="ciTests.json" credsIssuerConfigArg=false}} |
| {{>test_cluster tests="manualTests.json" credsIssuerConfigArg=false}} |
| |
| #endif // CONFIG_ENABLE_YAML_TESTS |
| |
| void registerCommandsTests(Commands & commands) |
| { |
| const char * clusterName = "Tests"; |
| |
| commands_list clusterCommands = { |
| #if CONFIG_ENABLE_YAML_TESTS |
| make_unique<TestList>(), |
| make_unique<ManualTestList>(), |
| {{#chip_tests "ciTests.json" includeAllClusters=true}} |
| make_unique<{{filename}}>(), |
| {{/chip_tests}} |
| {{#chip_tests "manualTests.json" includeAllClusters=true}} |
| make_unique<{{filename}}>(), |
| {{/chip_tests}} |
| #endif // CONFIG_ENABLE_YAML_TESTS |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |