6import isystem.connect
as ic
7import export_trace_data
13def test_createInstance():
14 conn_mgr = ic.ConnectionMgr()
15 conn_mgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
17 print(
"Exporting entire trace data to XML from a current trace controller... ")
18 trace_ctrl = ic.CTraceController(conn_mgr, export_trace_data.EXAMPLE_TRD_FILE,
"u")
19 trace_ctrl.waitUntilLoaded(1000)
20 trace_data = ic.CTraceData.createInstance(trace_ctrl,
"test_createInstance.xml", 0, 0,
False)
21 trace_ctrl.closeDiscard()
22 trace_data.closeParser()
24 file_path = os.path.join(os.getcwd(),
"test_createInstance.xml")
25 print(f
"\tDone: {file_path}")
27 xml_file_path, bin_file_path = export_trace_data.export_data(conn_mgr)
28 print(f
"Reading existing trace data XML file: {xml_file_path}")
29 trace_data = ic.CTraceData.createInstance(xml_file_path)
30 trace_data.closeParser()
32 print(f
"Reading existing trace data BIN file: {bin_file_path}")
33 fmt = ic.CTraceBinExportFormat()
34 fmt.setHeaderVersion(ic.CTraceBinExportFormat.EHeaderVer2)
36 trace_data = ic.CTraceData.createInstance(bin_file_path, fmt)
37 trace_data.closeParser()
40if __name__ ==
"__main__":