Previous 199869 Revisions Next

r36298 Friday 6th March, 2015 at 21:44:48 UTC by Mike Naberezny
jedtest.py: Python 3 compat. (nw)
[src/regtests/jedutil]jedtest.py

trunk/src/regtests/jedutil/jedtest.py
r244809r244810
5858    for test in tests:
5959        command = [jedUtilApp, "-view", test.jedFile, test.name]
6060        if VERBOSE:
61            print "Viewing the JED file: %s" % test.jedFile
62            print "Command: %s" % " ".join(command)
61            print("Viewing the JED file: %s" % test.jedFile)
62            print("Command: %s" % " ".join(command))
6363
6464        process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
6565        (stdout,stderr) = process.communicate()
6666       
6767        if stderr:
68            print "Error: JED test named " + test.name + " failed during viewing (" + stderr.strip() + ")."
68            print("Error: JED test named " + test.name + " failed during viewing (" + stderr.decode('latin-1').strip() + ").")
6969
7070        fp = open(test.outputFile, "wb")
7171        fp.write(stdout)
r244809r244810
8585        jedUtilApp = os.path.normpath(os.path.join(currentDirectory, "..", "..", "..", "jedutil"))
8686
8787    if VERBOSE:
88        print "JED Path:      %s" % jedsPath
89        print "Baseline Path: %s" % baselinePath
90        print "Output Path:   %s" % outputPath
91        print "jedutil App:   %s" % jedUtilApp
92        print
88        print("JED Path:      %s" % jedsPath)
89        print("Baseline Path: %s" % baselinePath)
90        print("Output Path:   %s" % outputPath)
91        print("jedutil App:   %s" % jedUtilApp)
92        print('')
9393
9494
9595    # Insure everything exists
r244809r244810
9797        not os.path.exists(jedsPath) or
9898        not os.path.exists(baselinePath) or
9999        not os.path.exists(jedUtilApp)):
100        print "One of the above paths does not exist.  Aborting. %s" % jedUtilApp
100        print("One of the above paths does not exist.  Aborting. %s" % jedUtilApp)
101101        return 3
102102
103103
104104    # Gather the tests
105105    tests = findJedTests(jedsPath, baselinePath, outputPath)
106106    if not len(tests):
107        print "No tests found!"
107        print("No tests found!")
108108        return 2
109109
110110
111111    # Setup the output paths
112112    if VERBOSE:
113        print "Cleaning the output directory"
114        print
113        print("Cleaning the output directory")
114        print('')
115115    if os.path.exists(outputPath):
116116        shutil.rmtree(outputPath)
117117    os.makedirs(outputPath)
r244809r244810
129129    success = True
130130    for test in tests:
131131        if VERBOSE:
132            print "Diffing the output from viewing the JED file: %s" % os.path.basename(test.jedFile)
132            print("Diffing the output from viewing the JED file: %s" % os.path.basename(test.jedFile))
133133        if not filecmp.cmp(test.outputFile, test.baselineFile):
134134            success = False
135            print "Test %s failed" % os.path.basename(test.jedFile)
135            print("Test %s failed" % os.path.basename(test.jedFile))
136136
137137
138138    # Report
139139    if success:
140        print "All tests ran successfully."
140        print("All tests ran successfully.")
141141        return 0
142142
143143


Previous 199869 Revisions Next


© 1997-2024 The MAME Team