winIDEA SDK
Loading...
Searching...
No Matches
test_coverage_export_data.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
#
# (c) TASKING Germany GmbH, 2023
import os
import isystem.connect as ic
winidea_id = ''
def test_exportData():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
covCtrl = ic.CCoverageController2(connMgr, 'sdk_example.trd', "u")
covCtrl.waitUntilLoaded(5000, isThrow=True)
exportCfg = ic.CCoverageExportConfig()
exportCfg.setFileName("cvrgExport.html")
exportCfg.setComment("Example HTML export overview.")
formatter = ic.CCoverageHTMLExportFormat()
exportCfg.setFormatter(formatter)
exportCfg.setFunctionsFilter("ma*") # match main()
exportCfg.setExportFunctionAsm(True) # include assembler code
covCtrl.exportData(exportCfg)
folderPath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_DIR)
filePath = os.path.join(folderPath, "test_exportData.xml")
print(f"Coverage data exported: {filePath}")
covCtrl.close()
if __name__ == "__main__":
test_exportData()