|
17 | 17 | #
|
18 | 18 |
|
19 | 19 | import base64
|
| 20 | +import click |
20 | 21 | import os
|
21 | 22 | import pathlib
|
22 | 23 | import sys
|
|
29 | 30 | from MockTestRunner import AsyncMock, MockTestRunner
|
30 | 31 |
|
31 | 32 | try:
|
32 |
| - from matter_testing_support import get_default_paa_trust_store, run_tests_no_exit |
| 33 | + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit |
33 | 34 | except ImportError:
|
34 | 35 | sys.path.append(os.path.abspath(
|
35 | 36 | os.path.join(os.path.dirname(__file__), '..')))
|
36 |
| - from matter_testing_support import get_default_paa_trust_store, run_tests_no_exit |
| 37 | + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit |
37 | 38 |
|
38 | 39 | invoke_call_count = 0
|
39 | 40 | event_call_count = 0
|
@@ -147,14 +148,19 @@ def run_test_with_mock(self, dynamic_invoke_return: typing.Callable, dynamic_eve
|
147 | 148 | return run_tests_no_exit(self.test_class, self.config, hooks, self.default_controller, self.stack)
|
148 | 149 |
|
149 | 150 |
|
150 |
| -def main(): |
| 151 | +@click.command() |
| 152 | +@click.argument('th_server_app', type=click.Path(exists=True)) |
| 153 | +def main(th_server_app: str): |
151 | 154 | root = os.path.abspath(os.path.join(pathlib.Path(__file__).resolve().parent, '..', '..', '..'))
|
152 | 155 | print(f'root = {root}')
|
153 | 156 | paa_path = get_default_paa_trust_store(root)
|
154 | 157 | print(f'paa = {paa_path}')
|
155 | 158 |
|
156 | 159 | pics = {"PICS_SDK_CI_ONLY": True}
|
157 | 160 | test_runner = MyMock('TC_CCTRL_2_2', 'TC_CCTRL_2_2', 'test_TC_CCTRL_2_2', 1, paa_trust_store_path=paa_path, pics=pics)
|
| 161 | + config = MatterTestConfig() |
| 162 | + config.user_params = {'th_server_app_path': th_server_app} |
| 163 | + test_runner.set_test_config(config) |
158 | 164 |
|
159 | 165 | test_runner.run_test_with_mock(dynamic_invoke_return, dynamic_event_return, wildcard())
|
160 | 166 | test_runner.Shutdown()
|
|
0 commit comments