trunk/src/regtests/chdman/chdtest.py
r23757 | r23758 | |
58 | 58 | outFile = os.path.join(root, d, "out.chd").replace("input", "output") |
59 | 59 | tempFilePath = os.path.join(tempPath, d) |
60 | 60 | tempFile = os.path.join(tempFilePath, "out.chd") |
| 61 | inParams = inFile + ".params" |
| 62 | params = [] |
| 63 | if os.path.exists(inParams): |
| 64 | f = open(inParams, 'r') |
| 65 | paramsstr = f.read() |
| 66 | f.close() |
| 67 | params = paramsstr.split(" ") |
61 | 68 | cmd = [] |
62 | 69 | if not os.path.exists(tempFilePath): |
63 | 70 | os.makedirs(tempFilePath) |
r23757 | r23758 | |
66 | 73 | inFile += "." + ext |
67 | 74 | cmd = [chdmanBin, "createcd", "-f", "-i", inFile, "-o", tempFile] |
68 | 75 | elif d.startswith("createhd"): |
69 | | inFile += ".params" |
70 | | f = open(inFile, 'r') |
71 | | paramsstr = f.read() |
72 | | f.close() |
73 | | params = paramsstr.split(" ") |
74 | | cmd = [chdmanBin, "createhd", "-f", "-o", tempFile] + params |
| 76 | cmd = [chdmanBin, "createhd", "-f", "-o", tempFile] |
75 | 77 | elif d.startswith("copy"): |
76 | 78 | inFile += ".chd" |
77 | 79 | cmd = [chdmanBin, "copy", "-f", "-i", inFile, "-o", tempFile] |
78 | 80 | else: |
79 | 81 | print "unsupported mode" |
80 | 82 | continue |
| 83 | cmd += params |
81 | 84 | exitcode, stdout, stderr = runProcess(cmd) |
82 | 85 | if not exitcode == 0: |
83 | 86 | print d + " - command failed with " + str(exitcode) + " (" + stderr + ")" |