@@ -24,20 +24,21 @@ is defined by a ZAP config file and tests can be added with a
24
24
25
25
- [ Building Prerequisites] ( ./BUILDING.md#prerequisites )
26
26
- [ Prepare For Building] ( ./BUILDING.md#prepare-for-building )
27
+ - [ Code Generate] ( ../code_generation.md )
28
+ - [ ZAP Installed] ( ../code_generation.md#installing-zap-and-environment-variables )
27
29
28
- ## Generating and building the default Simulated App with Script
30
+ ## Building the default Simulated App with Script
29
31
30
32
In order to utilize the app against a commissioner or controller, the app will
31
33
need to be specifically built.
32
34
33
- 1 . To generate the ZAP files, and build the ` chip-app1 ` binary completing the
34
- following steps:
35
+ 1 . To build the ` chip-app1 ` binary completing the following steps:
35
36
36
37
```
37
- ./scripts/examples/gn_build_test_example .sh app1
38
+ ./scripts/examples/gn_build_example .sh examples/placeholder/linux out/debug/simulated/ chip_tests_zap_config=\" app1\"
38
39
```
39
40
40
- ## Build the App only
41
+ ## Build the App with gn and ninja
41
42
42
43
In order to utilize the app against a commissioner or controller, the app will
43
44
need to be specifically built.
@@ -46,13 +47,7 @@ need to be specifically built.
46
47
47
48
```
48
49
source scripts/activate.sh
49
- CHIP_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
50
- GN_ARGS="chip_tests_zap_config=\"app1\""
51
- GN_ARGS+="chip_project_config_include_dirs=[\"$CHIP_ROOT/examples/placeholder/linux/apps/app1/include\", \"$CHIP_ROOT/config/standalone\"]"
52
- GN_ARGS+="chip_config_network_layer_ble=false"
53
-
54
- gn gen --check --fail-on-unused-args --root=examples/placeholder/linux out/simulated --args="$GN_ARGS"
55
-
50
+ gn gen --check --root=examples/placeholder/linux out/simulated --args="chip_tests_zap_config=\"app1\""
56
51
ninja -C out/simulated
57
52
```
58
53
@@ -61,24 +56,18 @@ need to be specifically built.
61
56
Now that the building is completed there is a `chip-app1` binary created. This
62
57
binary can be executed on a linux os.
63
58
64
- 1. To generate the ZAP files, and build the `chip-app1` binary completing the
65
- following steps:
66
-
67
- ```
68
- ./out/simulated/chip-app1
69
- ```
59
+ ```
60
+ ./out/simulated/chip-app1
61
+ ```
70
62
71
63
## Running the app with test parameter
72
64
73
65
Now that the building is completed there is a `chip-app1` binary created. This
74
66
binary can be executed on a linux os with test commands.
75
67
76
- 1. To generate the ZAP files, and build the `chip-app1` binary completing the
77
- following steps:
78
-
79
- ```
80
- ./out/simulated/chip-app1 --command [TEST NAME]
81
- ```
68
+ ```
69
+ ./out/simulated/chip-app1 --command [ TEST NAME]
70
+ ```
82
71
83
72
## Interacting with the simulated app
84
73
@@ -88,11 +77,13 @@ interact with it using chip-tool
88
77
1. Follow the instruction to build chip-tool in the
89
78
[chip-tool readme](../../examples/chip-tool/README.md).
90
79
91
- 2. Run this command to commission.
80
+ 2. Run this command to commission with whatever is listed on the "SetupQRCode:"
81
+ line in the log output:
82
+
92
83
```
93
- ./out/debug/standalone/chip-tool pairing code 0x654321 MT:-24J0AFN00KA0648G00
84
+ ./out/debug/standalone/chip-tool pairing code 0x654321 MT:-24J0AFN00KA0648G00
94
85
```
95
- or whatever is listed on the "SetupQRCode:" line in the log output.
86
+
96
87
3. Most tests will start at this point and now an send cluster commands with
97
88
chip-tool as follow.
98
89
@@ -113,14 +104,18 @@ new code is generated.
113
104
114
105
1. YAML test file are located in
115
106
[YAML folder](../../src/app/tests/suites/certification/)
107
+
116
108
2. Test names must follow a strict format dues to CI of test recognition. The
117
109
format is as follows:
110
+
118
111
- Test_TC\_[`CATEGORY ABBREVIATION`]\_[`SECTION NUMBER`]\_[`SUBSECTION
119
112
NUMBER`]\_Simulated.yaml
120
113
- <strong>`IMPORTANT`: The test name must end in Simulated with the
121
114
capital.</strong>
115
+
122
116
3. Available properties can be found in
123
117
[YAML Test Name](../../src/app/tests/suites/README.md)
118
+
124
119
4. An Additional property is as follows:
125
120
126
121
| Name | Description |
@@ -129,14 +124,26 @@ new code is generated.
129
124
130
125
5. [Test_TC_DM_1_3_Simulated](../../src/app/tests/suites/certification/Test_TC_DM_1_3_Simulated.yaml)
131
126
is an example of a written test that runs on the simulated device.
127
+
132
128
6. Next, it will need to be added to
133
- [examples/placeholder/linux/apps/app1/tests.js](../../examples/placeholder/linux/apps/app1/tests.js).
134
- in the following array
129
+ [examples/placeholder/linux/apps/app1/tests.js](../../examples/placeholder/linux/apps/app1/tests.js)
130
+ in the following array:
131
+
135
132
```javascript
136
133
const tests = ["Test_TC_DM_1_3_Simulated"];
137
134
```
138
- 7. Then, the code will be generated using ZAP. Follow
139
- [Gen Script](#generating-and-building-the-default-simulated-app-with-script)
140
- to do so.
141
- 8. When submitting code for review, create 2 commits. One for YAML changes and
135
+
136
+ 7. Then, the code will be generated using ZAP.
137
+
138
+ ```
139
+ ./scripts/tools/zap/generate.py examples/placeholder/linux/apps/app1/config.zap -t examples/placeholder/templates/templates.json -o zzz_generated/placeholder/app1/zap-generated
140
+ ```
141
+
142
+ The following command can be used to generate and compile:
143
+
144
+ ```
145
+ ./scripts/examples/gn_build_test_example.sh app1
146
+ ```
147
+
148
+ 8) When submitting code for review, create 2 commits. One for YAML changes and
142
149
second for generated code.
0 commit comments