Skip to content

Commit a261c63

Browse files
committed
Move the test suite into a top-level directory.
See discussion in #129 .
1 parent 92fa2c7 commit a261c63

32 files changed

+7
-5
lines changed

ml-proto/runtests.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

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

4040
def generate_test_cases(cls, interpreterPath, files):
4141
for fileName in files:
42-
attrName = fileName
42+
# The test harness needs test names to begin with "test/" regardless of
43+
# their actual path.
44+
attrName = fileName.replace("../testsuite", "test/")
4345
rec = (attrName, fileName, interpreterPath)
4446
testCase = generate_test_case(rec)
4547
setattr(cls, attrName, testCase)
@@ -61,7 +63,7 @@ def rebuild_interpreter(path):
6163
interpreterPath = os.path.abspath("./wasm")
6264

6365
try:
64-
os.makedirs("test/output/")
66+
os.makedirs("../testsuite/output/")
6567
except OSError:
6668
pass
6769

@@ -72,6 +74,6 @@ def rebuild_interpreter(path):
7274
else:
7375
find_interpreter(interpreterPath)
7476

75-
testFiles = glob.glob("test/*.wast")
77+
testFiles = glob.glob("../testsuite/*.wast")
7678
generate_test_cases(RunTests, interpreterPath, testFiles)
7779
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.

0 commit comments

Comments
 (0)