|
87 | 87 | parser.add_argument("--net-config", dest="net_config", type=str,
|
88 | 88 | default="EthernetInterface", help="Limit the tests to a networkinterface")
|
89 | 89 |
|
| 90 | + parser.add_argument("--module-config", dest="module_config", type=str, |
| 91 | + default=None, help="Test config for a module") |
| 92 | + |
90 | 93 | parser.add_argument("--test-spec", dest="test_spec",
|
91 | 94 | default=None, help="Destination path for a test spec file that can be used by the Greentea automated test tool")
|
92 | 95 |
|
|
136 | 139 | "Currently set search path: %s"
|
137 | 140 | % (toolchain, search_path))
|
138 | 141 |
|
139 |
| - net_configs = find_configs(mcu) # will be {} if target has no network configs |
140 |
| - # If there is no app config and the target has network configs |
141 |
| - # TODO: merge app_config and net_config if there is both |
142 |
| - if net_configs and not options.app_config: |
143 |
| - # use a specified network config |
| 142 | + # Assign config file. Precedence: module_config>net_config>app_config |
| 143 | + # TODO: merge configs if there are multiple |
| 144 | + if options.module_config: |
| 145 | + config = options.module_config |
| 146 | + elif find_configs(mcu): |
| 147 | + net_configs = find_configs(mcu) # will be {} if target has no network configs |
144 | 148 | config = net_configs[options.net_config]
|
145 | 149 | else:
|
146 | 150 | config = options.app_config
|
147 | 151 |
|
148 | 152 | # Find all tests in the relevant paths
|
149 | 153 | for path in all_paths:
|
150 | 154 | all_tests.update(find_tests(path, mcu, toolchain,
|
151 |
| - app_config=config)) |
| 155 | + app_config=config, |
| 156 | + module_config=options.module_config)) |
152 | 157 |
|
153 | 158 | # Filter tests by name if specified
|
154 | 159 | if options.names:
|
|
0 commit comments