Skip to content

Commit

Permalink
[Darwin] Remove auto generated tests (#17843)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored Apr 29, 2022
1 parent 60322cb commit 145d7bf
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 67,982 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "CHIPDevice_Internal.h"

#import "zap-generated/tests/CHIPClustersTest.h"
#import "zap-generated/CHIPTestClustersObjc.h"
#import "zap-generated/cluster/CHIPTestClustersObjc.h"

#include <lib/support/CHIPListUtils.h>
#include <type_traits>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class {{filename}}: public TestCommandBridge

{{#chip_tests_items}}
{{#if async}}
bool testSendCluster{{parent.filename}}_{{asTestIndex index}}_{{asUpperCamelCase command}}_Fulfilled = false;
bool testSendCluster{{parent.filename}}_{{index}}_{{asUpperCamelCase command}}_Fulfilled = false;
{{/if}}
{{#chip_tests_item_responses}}
{{#chip_tests_item_response_parameters}}
Expand Down Expand Up @@ -140,7 +140,7 @@ class {{filename}}: public TestCommandBridge
maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument]
params:params
subscriptionEstablished:^{
VerifyOrReturn(testSendCluster{{parent.filename}}_{{asTestIndex waitForReport.index}}_{{asUpperCamelCase waitForReport.command}}_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE));
VerifyOrReturn(testSendCluster{{parent.filename}}_{{waitForReport.index}}_{{asUpperCamelCase waitForReport.command}}_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE));
NextTest();
}
reportHandler:^({{asObjectiveCClass attributeObject.type cluster forceList=attributeObject.isArray}} * _Nullable value, NSError * _Nullable err) {
Expand Down Expand Up @@ -235,7 +235,7 @@ class {{filename}}: public TestCommandBridge
{{#unless async}}
NextTest();
{{else}}
testSendCluster{{parent.filename}}_{{asTestIndex ../index}}_{{asUpperCamelCase command}}_Fulfilled = true;
testSendCluster{{parent.filename}}_{{../index}}_{{asUpperCamelCase command}}_Fulfilled = true;
{{/unless}}
{{else}}
{{! We're a subscription }}
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool-darwin/templates/tests/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"../../../../src/app/zap-templates/templates/chip/helper.js",
"../../../../src/app/zap-templates/common/ClusterTestGeneration.js",
"../../../../src/darwin/Framework/CHIP/templates/helper.js",
"../../../../src/darwin/Framework/CHIP/templates/tests/helper.js",
"../helper.js",
"tests.js"
],
Expand Down
7 changes: 1 addition & 6 deletions scripts/tools/zap_regen_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def setupArgumentsParser():
description='Generate content from ZAP files')
parser.add_argument('--type', default='all', choices=['all', 'tests'],
help='Choose which content type to generate (default: all)')
parser.add_argument('--tests', default='all', choices=['all', 'chip-tool', 'chip-tool-darwin', 'darwin', 'app1', 'app2'],
parser.add_argument('--tests', default='all', choices=['all', 'chip-tool', 'chip-tool-darwin', 'app1', 'app2'],
help='When generating tests only target, Choose which tests to generate (default: all)')
parser.add_argument('--dry-run', default=False, action='store_true',
help="Don't do any generationl just log what targets would be generated (default: False)")
Expand Down Expand Up @@ -145,11 +145,6 @@ def getTestsTemplatesTargets(test_target):
'zap': 'src/controller/data_model/controller-clusters.zap',
'template': 'examples/chip-tool-darwin/templates/tests/templates.json',
'output_dir': 'zzz_generated/chip-tool-darwin/zap-generated'
},
'darwin': {
'zap': 'src/controller/data_model/controller-clusters.zap',
'template': 'src/darwin/Framework/CHIP/templates/tests/templates.json',
'output_dir': None
}
}

Expand Down
8 changes: 0 additions & 8 deletions src/darwin/Framework/CHIP.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
1E16A90226B98AB700683C53 /* CHIPTestClustersObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1E16A8FA26B9835700683C53 /* CHIPTestClustersObjc.mm */; };
1E16A90326B98AF100683C53 /* CHIPTestClustersObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E16A8F926B9835600683C53 /* CHIPTestClustersObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
1E85730C265519AE0050A4D9 /* callback-stub.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E857307265519AE0050A4D9 /* callback-stub.cpp */; };
1EB41B7B263C4CC60048E4C1 /* CHIPClustersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EB41B7A263C4CC60048E4C1 /* CHIPClustersTests.m */; };
1EC3238D271999E2002A8BF0 /* cluster-objects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */; };
Expand Down Expand Up @@ -112,8 +110,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
1E16A8F926B9835600683C53 /* CHIPTestClustersObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CHIPTestClustersObjc.h; path = "zap-generated/CHIPTestClustersObjc.h"; sourceTree = "<group>"; };
1E16A8FA26B9835700683C53 /* CHIPTestClustersObjc.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CHIPTestClustersObjc.mm; path = "zap-generated/CHIPTestClustersObjc.mm"; sourceTree = "<group>"; };
1E857307265519AE0050A4D9 /* callback-stub.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "callback-stub.cpp"; path = "../../../../zzz_generated/controller-clusters/zap-generated/callback-stub.cpp"; sourceTree = "<group>"; };
1EB41B7A263C4CC60048E4C1 /* CHIPClustersTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CHIPClustersTests.m; sourceTree = "<group>"; };
1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "cluster-objects.cpp"; path = "../../../../zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -250,8 +246,6 @@
51B22C212740CB1D008D5055 /* CHIPCommandPayloadsObjc.h */,
51B22C1D2740CB0A008D5055 /* CHIPStructsObjc.h */,
1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */,
1E16A8F926B9835600683C53 /* CHIPTestClustersObjc.h */,
1E16A8FA26B9835700683C53 /* CHIPTestClustersObjc.mm */,
1ED276DF26C57CF000547A89 /* CHIPCallbackBridge.mm */,
1E857307265519AE0050A4D9 /* callback-stub.cpp */,
1EC4CE6325CC276600D7304F /* CHIPClustersObjc.h */,
Expand Down Expand Up @@ -394,7 +388,6 @@
51B22C1E2740CB0A008D5055 /* CHIPStructsObjc.h in Headers */,
2CB7163B252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.h in Headers */,
5ACDDD7A27CD129700EFD68A /* CHIPAttributeCacheContainer.h in Headers */,
1E16A90326B98AF100683C53 /* CHIPTestClustersObjc.h in Headers */,
5A6FEC9227B5669C00F25F42 /* CHIPDeviceControllerOverXPC.h in Headers */,
2C1B027B2641DB4E00780EF1 /* CHIPOperationalCredentialsDelegate.h in Headers */,
99D466E12798936D0089A18F /* CHIPCommissioningParameters.h in Headers */,
Expand Down Expand Up @@ -561,7 +554,6 @@
997DED162695343400975E97 /* CHIPThreadOperationalDataset.mm in Sources */,
27A53C1827FBC6920053F131 /* CHIPAttestationTrustStoreBridge.mm in Sources */,
998F287126D56940001846C6 /* CHIPP256KeypairBridge.mm in Sources */,
1E16A90226B98AB700683C53 /* CHIPTestClustersObjc.mm in Sources */,
5136661428067D550025EDAE /* MatterControllerFactory.mm in Sources */,
51B22C2A2740CB47008D5055 /* CHIPCommandPayloadsObjc.mm in Sources */,
2C5EEEF7268A85C400CAE3D3 /* CHIPDeviceConnectionBridge.mm in Sources */,
Expand Down
10 changes: 0 additions & 10 deletions src/darwin/Framework/CHIP/templates/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@
"name": "Objc reflections of CHIP command payloads header",
"output": "src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm"
},
{
"path": "../../../../../examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc.zapt",
"name": "Test Objc API Header",
"output": "src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h"
},
{
"path": "../../../../../examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt",
"name": "Test Objc API",
"output": "src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm"
},
{
"path": "CHIPAttributeTLVValueDecoder-src.zapt",
"name": "Decode TLV attribute values into Objc objects",
Expand Down
237 changes: 0 additions & 237 deletions src/darwin/Framework/CHIP/templates/tests/CHIPClustersTests.zapt

This file was deleted.

35 changes: 0 additions & 35 deletions src/darwin/Framework/CHIP/templates/tests/helper.js

This file was deleted.

Loading

0 comments on commit 145d7bf

Please sign in to comment.