1
- #CHIP EFR32 Test Driver
1
+ This is a test driver for the Matter unit tests to be run on an EFR32 device. It
2
+ builds a set of test binaries, each of which contains one directory of unit
3
+ tests that can be flashed onto a device and run. The device is controlled using
4
+ the included RPCs through the python test runner.
2
5
3
- This builds and runs the unit tests on the efr32 device.
6
+ - [ Prerequisites] ( #prerequisites )
7
+ - [ Building and Running the Unit Tests] ( #building-and-running-the-unit-tests )
8
+ - [ Building and Running the Unit Tests with the build_examples Script] ( #building-and-running-the-unit-tests-with-the-build_examples-script )
4
9
5
- <hr >
6
-
7
- - [ Introduction] ( #introduction )
8
- - [ Building] ( #building )
9
- - [ Running The Tests] ( #running-the-tests )
10
-
11
- <hr >
12
-
13
- <a name =" introduction " ></a >
14
-
15
- ## Introduction
16
-
17
- This builds a set of test binaries which contain the unit tests and can be
18
- flashed onto a device. The device is controlled using the included RPCs, through
19
- the python test runner.
20
-
21
- <a name =" building " ></a >
22
-
23
- ## Building
10
+ ## Prerequisites
24
11
25
12
- Download the
26
13
[ Simplicity Commander] ( https://www.silabs.com/mcu/programming-options )
27
- command line tool, and ensure that ` commander ` is your shell search path.
14
+ command line tool, and ensure that ` commander ` is in your shell search path.
28
15
(For Mac OS X, ` commander ` is located inside
29
16
` Commander.app/Contents/MacOS/ ` .)
30
17
31
18
- Download and install a suitable ARM gcc tool chain (For most Host, the
32
19
bootstrap already installs the toolchain):
33
20
[ GNU Arm Embedded Toolchain 12.2 Rel1] ( https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads )
34
21
35
- - Install some additional tools(likely already present for CHIP developers) :
22
+ - Install some additional tools:
36
23
37
- # Linux ` sudo apt-get install git libwebkitgtk-1.0-0 ninja-build `
24
+ For Linux: ` sudo apt-get install git libwebkitgtk-1.0-0 ninja-build `
38
25
39
- # Mac OS X ` brew install ninja `
26
+ For Mac OS: ` brew install ninja `
40
27
41
28
- Supported hardware:
42
29
@@ -49,60 +36,49 @@ the python test runner.
49
36
- BRD4187A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm
50
37
- BRD4187C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm
51
38
52
- OR use GN/Ninja directly
39
+ ## Building and Running the Unit Tests
53
40
54
- ```
55
- cd ~/connectedhomeip/src/test_driver/efr32/
56
- git submodule update --init
57
- source third_party/connectedhomeip/scripts/activate.sh
58
- export SILABS_BOARD=BRD4187C
59
- gn gen out/debug
60
- ninja -C out/debug
61
- ```
41
+ ### Building the Unit Tests
62
42
63
- - To delete generated executable, libraries and object files use:
43
+ The unit tests can be built using gn and ninja. Set the appropriate board name.
64
44
65
- ```
66
- cd ~/connectedhomeip/src/test_driver/efr32/
67
- rm -rf out/
68
- ```
69
-
70
- <a name =" running-the-tests " ></a >
45
+ source scripts/activate.sh
46
+ cd src/test_driver/efr32
47
+ export SILABS_BOARD=BRD2703A
48
+ gn gen out/debug
49
+ ninja -C out/debug
71
50
72
- ## Running The Tests
51
+ ### Building and Installing the Runner
73
52
74
- Build the runner using gn :
53
+ The python wheels for the runner can be built and installed like this :
75
54
76
- ```
77
- cd <connectedhomeip>/src/test_driver/efr32
78
- gn gen out/debug
79
55
ninja -C out/debug runner
80
- ```
56
+ pip3 install out/debug/chip_pw_test_runner_wheels/*.whl --force-reinstall
57
+
58
+ ### Running the Unit Tests
59
+
60
+ The unit tests can be run using the test runner python script:
61
+
62
+ python -m py.pw_test_runner.pw_test_runner -d /dev/ttyACM1 -f out/debug/tests -o out.log
63
+
64
+ ## Building and Running the Unit Tests with the build_examples Script
81
65
82
- Or build using build script from the root
66
+ ### Building the Unit Tests
83
67
84
- ```
85
- cd <connectedhomeip>
86
- ./scripts/build/build_examples.py --target linux-x64-pw-test-runner build
87
- ```
68
+ The unit tests can be built using the build_examples script. Set the appropriate
69
+ board name.
88
70
89
- The runner will be installed into the venv and python wheels will be packaged in
90
- the output folder for deploying.
71
+ scripts/build/build_examples.py --target efr32-brd2703a-unit-test build
91
72
92
- Then the python wheels need to installed using pip3.
73
+ ### Building and Installing the Runner
93
74
94
- ```
95
- pip3 install out/debug/chip_pw_test_runner_wheels/*.whl
96
- ```
75
+ The python wheels for the runner can be built and installed like this:
97
76
98
- Other python libraries may need to be installed such as
77
+ scripts/build/build_examples.py --target linux-x64-efr32-test-runner build
78
+ pip3 install out/linux-x64-efr32-test-runner/chip_pw_test_runner_wheels/*.whl --force-reinstall
99
79
100
- ```
101
- pip3 install pyserial
102
- ```
80
+ ### Running the Unit Tests
103
81
104
- - To run all tests :
82
+ The unit tests can be run using the test runner python script :
105
83
106
- ```
107
- python -m pw_test_runner.pw_test_runner -d /dev/ttyACM1 -f out/debug/matter-silabs-device_tests.s37 -o out.log
108
- ```
84
+ python -m src.test_driver.efr32.py.pw_test_runner.pw_test_runner -d /dev/ttyACM1 -f out/efr32-brd2703a-unit-test/tests -o out.log
0 commit comments