winIDEA SDK
Loading...
Searching...
No Matches
test_coverage_create_instance.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_createInstance():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
print(f"Creating fresh .trd file and exporting to XML, data loaded into the memory...")
covCtrl = ic.CCoverageController2(connMgr, "test_createInstance.trd", "w")
covData = ic.CCoverageData2.createInstance(covCtrl, "test_createInstance.xml", True)
covData.closeParser()
folderPath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_DIR)
filePath = os.path.join(folderPath, "test_createInstance.xml")
print(f"Coverage data and file released: {filePath}")
print(f"Load existing coverage data (XML) file: {filePath}")
covData = ic.CCoverageData2.createInstance(filePath, True)
covData.closeParser()
covCtrl.close()
print("Coverage data and file released.")
if __name__ == "__main__":
test_createInstance()