Skip to content

Commit

Permalink
Allow simulated apps to have separate templates. (#25378)
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton36 authored and pull[bot] committed Sep 18, 2023
1 parent ed93ad4 commit 3294593
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 73 deletions.
72 changes: 72 additions & 0 deletions examples/placeholder/linux/apps/app1/templates/templates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "Placeholder templates",
"version": "chip-v1",
"helpers": [
"partials/helper.js",
"common/StringHelper.js",
"templates/app/helper.js",
"templates/chip/helper.js",
"common/ClusterTestGeneration.js",
"chip-tool/templates/helper.js",
"chip-tool/templates/tests/helper.js"
],
"resources": {
"pics-metafile": "../../../../../../src/app/tests/suites/certification/PICS.yaml",
"certification-metadir": "../../../../../../src/app/tests/suites/certification",
"test-metadir": "../../../../../../src/app/tests/suites"
},
"override": "../../../../../../src/app/zap-templates/common/override.js",
"partials": [
{
"name": "header",
"path": "../../../../../../src/app/zap-templates/partials/header.zapt"
},
{
"name": "test_cluster",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/test_cluster.zapt"
},
{
"name": "test_step",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/test_step.zapt"
},
{
"name": "test_step_response",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/test_step_response.zapt"
},
{
"name": "maybeCheckExpectedValue",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedValue.zapt"
},
{
"name": "maybeCheckExpectedConstraints",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedConstraints.zapt"
},
{
"name": "maybeSaveAs",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/saveAs/maybeSaveAs.zapt"
},
{
"name": "setupSaveAs",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/saveAs/setupSaveAs.zapt"
},
{
"name": "teardownSaveAs",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/saveAs/teardownSaveAs.zapt"
},
{
"name": "commandValue",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/command_value.zapt"
},
{
"name": "valueEquals",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/value_equals.zapt"
}
],
"templates": [
{
"path": "../../../../templates/tests-commands.zapt",
"name": "Tests Commands header",
"output": "test/Commands.h"
}
]
}
72 changes: 72 additions & 0 deletions examples/placeholder/linux/apps/app2/templates/templates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "Placeholder templates",
"version": "chip-v1",
"helpers": [
"partials/helper.js",
"common/StringHelper.js",
"templates/app/helper.js",
"templates/chip/helper.js",
"common/ClusterTestGeneration.js",
"chip-tool/templates/helper.js",
"chip-tool/templates/tests/helper.js"
],
"resources": {
"pics-metafile": "../../../../../../src/app/tests/suites/certification/PICS.yaml",
"certification-metadir": "../../../../../../src/app/tests/suites/certification",
"test-metadir": "../../../../../../src/app/tests/suites"
},
"override": "../../../../../../src/app/zap-templates/common/override.js",
"partials": [
{
"name": "header",
"path": "../../../../../../src/app/zap-templates/partials/header.zapt"
},
{
"name": "test_cluster",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/test_cluster.zapt"
},
{
"name": "test_step",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/test_step.zapt"
},
{
"name": "test_step_response",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/test_step_response.zapt"
},
{
"name": "maybeCheckExpectedValue",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedValue.zapt"
},
{
"name": "maybeCheckExpectedConstraints",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedConstraints.zapt"
},
{
"name": "maybeSaveAs",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/saveAs/maybeSaveAs.zapt"
},
{
"name": "setupSaveAs",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/saveAs/setupSaveAs.zapt"
},
{
"name": "teardownSaveAs",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/saveAs/teardownSaveAs.zapt"
},
{
"name": "commandValue",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/command_value.zapt"
},
{
"name": "valueEquals",
"path": "../../../../../../examples/chip-tool/templates/tests/partials/value_equals.zapt"
}
],
"templates": [
{
"path": "../../../../templates/tests-commands.zapt",
"name": "Tests Commands header",
"output": "test/Commands.h"
}
]
}
72 changes: 0 additions & 72 deletions examples/placeholder/templates/templates.json

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/tools/zap_regen_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ def getGlobalTemplatesTargets():
# a name like <zap-generated/foo.h>
output_dir = os.path.join(
'zzz_generated', 'placeholder', example_name, 'zap-generated')
template = 'examples/placeholder/templates/templates.json'
template = os.path.join(
'examples', 'placeholder', 'linux', 'apps', example_name, 'templates', 'templates.json')

targets.append(ZAPGenerateTarget.MatterIdlTarget(filepath))
targets.append(ZAPGenerateTarget(filepath, output_dir=output_dir, template=template))
Expand Down

0 comments on commit 3294593

Please sign in to comment.