trunk/src/regtests/chdman/chdtest.py
| r23795 | r23796 | |
| 74 | 74 | if not sha1_extract_bin == sha1_extract_bin_2: |
| 75 | 75 | print "SHA1 mismatch (extractcd - " + type + " - bin) - expected: " + sha1_out + " found: " + sha1_temp |
| 76 | 76 | failure = True |
| 77 | |
| 78 | def extractAndCompare(command, ext): |
| 79 | extractFileDir = os.path.join(tempFilePath, ext + "_output") |
| 80 | if not os.path.exists(extractFileDir): |
| 81 | os.makedirs(extractFileDir) |
| 82 | extractFileBase = os.path.join(extractFileDir, "extract") |
| 83 | extractFile = extractFileBase + "." + ext |
| 84 | |
| 85 | exitcode, stdout, stderr = runProcess([chdmanBin, command, "-f", "-i", outFile, "-o", extractFile]) |
| 86 | if not exitcode == 0: |
| 87 | print d + " - " + command + " (" + ext + ") failed with " + str(exitcode) + " (" + stderr + ")" |
| 88 | failure = True |
| 89 | |
| 90 | sha1_extract = sha1sum(extractFile); |
| 91 | |
| 92 | extractFileDir = os.path.join(tempFilePath, ext + "_temp") |
| 93 | if not os.path.exists(extractFileDir): |
| 94 | os.makedirs(extractFileDir) |
| 95 | extractFileBase = os.path.join(extractFileDir, "extract") |
| 96 | extractFile = extractFileBase + "." + ext |
| 97 | |
| 98 | exitcode, stdout, stderr = runProcess([chdmanBin, command, "-f", "-i", tempFile, "-o", extractFile]) |
| 99 | if not exitcode == 0: |
| 100 | print d + " - " + command + " (" + ext + ") failed with " + str(exitcode) + " (" + stderr + ")" |
| 101 | failure = True |
| 102 | |
| 103 | sha1_extract_2 = sha1sum(extractFile); |
| 104 | |
| 105 | if not sha1_extract == sha1_extract_2: |
| 106 | print "SHA1 mismatch (" + command + " - " + ext + ") - expected: " + sha1_out + " found: " + sha1_temp |
| 107 | failure = True |
| 77 | 108 | |
| 78 | 109 | currentDirectory = os.path.dirname(os.path.realpath(__file__)) |
| 79 | 110 | inputPath = os.path.join(currentDirectory, 'input') |
| r23795 | r23796 | |
| 170 | 201 | if command == "createcd": |
| 171 | 202 | extractcdAndCompare("toc") |
| 172 | 203 | extractcdAndCompare("cue") |
| 173 | | # TODO: implement extraction for remaining cases |
| 204 | elif command == "createhd": |
| 205 | extractAndCompare("extracthd", "raw") |
| 206 | elif command == "createld": |
| 207 | extractAndCompare("extractld", "avi") |
| 174 | 208 | |
| 175 | 209 | # compare SHA1 of output files |
| 176 | 210 | sha1_out = sha1sum(outFile) |