diff --git a/package.json b/package.json index 920b00f9eea87f46e2ee9a4a70c2d352af0f862f..09e704f68824ee7f42679602c0d507632ee0d842 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "lintfix": "eslint --fix --ext .js,.vue src src-electron src-shared src-script test", "electron-build-dmg": "node src-script/build-dmg.js", "clean:report": "rm -rf .nyc_output || true", + "tsc": "tsc --build ./tsconfig.json", "test": " npm run test:unit && npm run test:e2e-ci && npm run report", "test:unit": "node src-script/zap-versionstamp.js && jest --reporters=jest-junit --reporters=default --updateSnapshot", "test:unit:verbose": "jest --updateSnapshot --verbose false", diff --git a/test/gen-matter.test.js b/test/gen-matter.test.js index c8dadbfe43044e7090e142d12bf6fe02adfb7bca..bfa2ee7a2394d1db346f35c6362a863ceab72a13 100644 --- a/test/gen-matter.test.js +++ b/test/gen-matter.test.js @@ -162,6 +162,11 @@ test( ) expect(deviceType).toContain('>> Attribute: identify time [0]') expect(deviceType).toContain('>> Command: TriggerEffect [64]') + + let events = genResult.content['events.out'] + expect(events).toContain('Field: arg4 [BITMAP]') + expect(events).toContain('Field: OperationSource [ENUM]') + expect(events).toContain('Field: SourceNode') }, testUtil.timeout.long() ) diff --git a/test/gen-template/matter/events.zapt b/test/gen-template/matter/events.zapt new file mode 100644 index 0000000000000000000000000000000000000000..a6dd68542f4217699b9a2387232fc453482dfc8a --- /dev/null +++ b/test/gen-template/matter/events.zapt @@ -0,0 +1,8 @@ +List of all events. + +{{#zcl_events}} +>> Event: {{name}} +{{#zcl_event_fields}} + > Field: {{name}} {{#if_is_enum type}}[ENUM]{{/if_is_enum}}{{#if_is_bitmap type}}[BITMAP]{{/if_is_bitmap}} +{{/zcl_event_fields}} +{{/zcl_events}} \ No newline at end of file diff --git a/test/gen-template/matter/gen-test.json b/test/gen-template/matter/gen-test.json index ce6309a25ab62e258a07d8a7f6eea1918eb2b466..07961913116ccb2bad2d47d2cfe9e95f8f39eebf 100644 --- a/test/gen-template/matter/gen-test.json +++ b/test/gen-template/matter/gen-test.json @@ -55,6 +55,11 @@ "path": "endpoint-config.zapt", "name": "Endpoint Configuration", "output": "endpoint-config.c" + }, + { + "path": "events.zapt", + "name": "Events", + "output": "events.out" } ] } diff --git a/test/test-util.js b/test/test-util.js index 061ede2ec79f954ae7235d5c6dd7fafd20d40527..2323d28e3debfd205b88569894bc7e39a0000187 100644 --- a/test/test-util.js +++ b/test/test-util.js @@ -80,7 +80,7 @@ exports.testTemplate = { zigbee: './test/gen-template/zigbee/gen-templates.json', zigbeeCount: 27, matter: './test/gen-template/matter/gen-test.json', - matterCount: 5, + matterCount: 6, dotdot: './test/gen-template/dotdot/dotdot-templates.json', dotdotCount: 5, unittest: './test/gen-template/test/gen-test.json', diff --git a/zcl-builtin/matter/test-cluster.xml b/zcl-builtin/matter/test-cluster.xml index 587c282fef8be96655d86e3e3ada3d79995d7341..ddea69d10e4d3658a74ac33a00b935b7d0fe2482 100644 --- a/zcl-builtin/matter/test-cluster.xml +++ b/zcl-builtin/matter/test-cluster.xml @@ -570,7 +570,7 @@ limitations under the License. <field id="1" name="arg1" type="INT8U"/> <field id="2" name="arg2" type="SimpleEnum"/> <field id="3" name="arg3" type="BOOLEAN"/> - <field id="4" name="arg4" type="SimpleStruct"/> + <field id="4" name="arg4" type="SimpleBitmap"/> <field id="5" name="arg5" type="SimpleStruct" array="true"/> <field id="6" name="arg6" type="SimpleEnum" array="true"/> </event>