winIDEA SDK
test_merge.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import os
6import isystem.connect as ic
7
8
9winidea_id = ''
10
11
12def test_merge():
13 connMgr = ic.ConnectionMgr()
14 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
15
16 covCtrl = ic.CCoverageController2(connMgr, "test_merge.trd", "w")
17 covCtrl1 = ic.CCoverageController2(connMgr, "test_merge_1.trd", "w")
18 covCtrl2 = ic.CCoverageController2(connMgr, "test_merge_2.trd", "w")
19
20 folderPath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_DIR)
21 filePath = os.path.join(folderPath, "test_merge.trd")
22 filePath1 = os.path.join(folderPath, "test_merge_1.trd")
23 filePath2 = os.path.join(folderPath, "test_merge_2.trd")
24
25 files = ic.StrVector()
26 files.append(filePath1)
27 files.append(filePath2)
28 covCtrl.merge(files)
29 print(f"Following files were merged to 'test_merge.trd' file: {filePath}")
30 print(f"\t{filePath1}")
31 print(f"\t{filePath2}")
32
33
34if __name__ == "__main__":
35 test_merge()