5import isystem.connect
as ic
11def init_target() -> ic.ConnectionMgr:
12 cmgr = ic.ConnectionMgr()
13 cmgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
15 debugCtrl = ic.CDebugFacade(cmgr)
18 debugCtrl.runUntilFunction(
'main')
19 debugCtrl.waitUntilStopped()
23def run_test(cmgr: ic.ConnectionMgr):
25 testCaseCtrl = ic.CTestCaseController(cmgr,
'sum',
'retVal')
26 testCaseCtrl.createParameter(0,
'param1')
27 testCaseCtrl.createParameter(1,
'param2')
28 testCaseCtrl.createParameter(2,
'param3')
30 testCaseCtrl.createVariable(
'newVariable',
'int[10]')
36 testCaseCtrl.modifyAsString(
'newVariable',
"{0, 1, 2, -6, 4, 5, 6, 7, 8, 9}")
37 testCaseCtrl.modify(
'newVariable[0]',
'10')
41 testCaseCtrl.modify(
'param1',
'5')
42 testCaseCtrl.modify(
'param2',
'newVariable[0]')
43 testCaseCtrl.modify(
'param3',
'newVariable[3]')
45 print(
'Running test...')
47 testCaseCtrl.waitUntilStopped()
50 state = testCaseCtrl.getStatus()
51 if state == ic.IConnectTest.stateEnded:
52 print(
'Test finished normally.')
54 print(
'Test ended in unexpected state: ', state)
58 rv = testCaseCtrl.evaluate(
'retVal,d')
59 print(
'return value: ', rv)
61 print(
'Test failed! retVal =', rv)
63 testCaseCtrl.destroy()
72if __name__ ==
'__main__':