MCPcopy Create free account
hub / github.com/ARMmbed/DAPLink / TestManager

Class TestManager

test/run_test.py:128–462  ·  view source on GitHub ↗

Handle tests configuration running and results

Source from the content-addressed store, hash-verified

126
127
128class TestManager(object):
129 """Handle tests configuration running and results"""
130
131 class _STATE(Enum):
132 INIT = 0
133 CONFIGURED = 1
134 COMPLETE = 2
135
136 def __init__(self):
137 # By default test all configurations and boards
138 self._target_list = []
139 self._board_list = []
140 self._firmware_list = []
141 self._only_test_first = False
142 self._load_if = True
143 self._load_bl = True
144 self._test_daplink = True
145 self._test_ep = True
146
147 # Internal state
148 self._state = self._STATE.INIT
149 self._test_configuration_list = None
150 self._all_tests_pass = None
151 self._firmware_filter = None
152 self._untested_firmware = None
153
154 @property
155 def all_tests_pass(self):
156 assert self._all_tests_pass is not None, 'Must call run_tests first'
157 return self._all_tests_pass
158
159 def set_test_first_board_only(self, first):
160 """Only test one board of each type"""
161 assert isinstance(first, bool)
162 assert self._state is self._STATE.INIT
163 self._only_test_first = first
164
165 def set_load_if(self, load):
166 """Load new interface firmware before testing"""
167 assert isinstance(load, bool)
168 assert self._state is self._STATE.INIT
169 self._load_if = load
170
171 def set_load_bl(self, load):
172 """Load new bootloader firmware before testing"""
173 assert isinstance(load, bool)
174 assert self._state is self._STATE.INIT
175 self._load_bl = load
176
177 def set_test_daplink(self, run_test):
178 """Run DAPLink specific tests"""
179 assert isinstance(run_test, bool)
180 assert self._state is self._STATE.INIT
181 self._test_daplink = run_test
182
183 def set_test_ep(self, run_test):
184 """Test each endpoint - MSD, CDC, HID"""
185 assert isinstance(run_test, bool)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68