Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions ml-proto/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class RunTests(unittest.TestCase):
def _runTestFile(self, shortName, fileName, interpreterPath):
logPath = fileName.replace("test/", "test/output/").replace(".wast", ".wast.log")
logPath = fileName.replace("../testsuite/", "../testsuite/output/").replace(".wast", ".wast.log")
try:
os.remove(logPath)
except OSError:
Expand All @@ -20,7 +20,7 @@ def _runTestFile(self, shortName, fileName, interpreterPath):
self.assertEqual(0, exitCode, "test runner failed with exit code %i" % exitCode)

try:
expected = open(fileName.replace("test/", "test/expected-output/").replace(".wast", ".wast.log"))
expected = open(fileName.replace("../testsuite/", "../testsuite/expected-output/").replace(".wast", ".wast.log"))
except IOError:
# print("// WARNING: No expected output found for %s" % fileName)
return
Expand All @@ -39,7 +39,9 @@ def generate_test_case(rec):

def generate_test_cases(cls, interpreterPath, files):
for fileName in files:
attrName = fileName
# The test harness needs test names to begin with "test/" regardless of
# their actual path.
attrName = fileName.replace("../testsuite", "test/")
rec = (attrName, fileName, interpreterPath)
testCase = generate_test_case(rec)
setattr(cls, attrName, testCase)
Expand All @@ -61,7 +63,7 @@ def rebuild_interpreter(path):
interpreterPath = os.path.abspath("./wasm")

try:
os.makedirs("test/output/")
os.makedirs("../testsuite/output/")
except OSError:
pass

Expand All @@ -72,6 +74,6 @@ def rebuild_interpreter(path):
else:
find_interpreter(interpreterPath)

testFiles = glob.glob("test/*.wast")
testFiles = glob.glob("../testsuite/*.wast")
generate_test_cases(RunTests, interpreterPath, testFiles)
unittest.main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.