diff --git a/ml-proto/runtests.py b/ml-proto/runtests.py index f9bf5ecfc7..60e7a9a244 100755 --- a/ml-proto/runtests.py +++ b/ml-proto/runtests.py @@ -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: @@ -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 @@ -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) @@ -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 @@ -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() diff --git a/ml-proto/test/.gitignore b/testsuite/.gitignore similarity index 100% rename from ml-proto/test/.gitignore rename to testsuite/.gitignore diff --git a/ml-proto/test/conversions.wast b/testsuite/conversions.wast similarity index 100% rename from ml-proto/test/conversions.wast rename to testsuite/conversions.wast diff --git a/ml-proto/test/endianness.wast b/testsuite/endianness.wast similarity index 100% rename from ml-proto/test/endianness.wast rename to testsuite/endianness.wast diff --git a/ml-proto/test/expected-output/imports.wast.log b/testsuite/expected-output/imports.wast.log similarity index 100% rename from ml-proto/test/expected-output/imports.wast.log rename to testsuite/expected-output/imports.wast.log diff --git a/ml-proto/test/expected-output/store_retval.wast.log b/testsuite/expected-output/store_retval.wast.log similarity index 100% rename from ml-proto/test/expected-output/store_retval.wast.log rename to testsuite/expected-output/store_retval.wast.log diff --git a/ml-proto/test/exports.wast b/testsuite/exports.wast similarity index 100% rename from ml-proto/test/exports.wast rename to testsuite/exports.wast diff --git a/ml-proto/test/f32.wast b/testsuite/f32.wast similarity index 100% rename from ml-proto/test/f32.wast rename to testsuite/f32.wast diff --git a/ml-proto/test/f32_cmp.wast b/testsuite/f32_cmp.wast similarity index 100% rename from ml-proto/test/f32_cmp.wast rename to testsuite/f32_cmp.wast diff --git a/ml-proto/test/f64.wast b/testsuite/f64.wast similarity index 100% rename from ml-proto/test/f64.wast rename to testsuite/f64.wast diff --git a/ml-proto/test/f64_cmp.wast b/testsuite/f64_cmp.wast similarity index 100% rename from ml-proto/test/f64_cmp.wast rename to testsuite/f64_cmp.wast diff --git a/ml-proto/test/fac.wast b/testsuite/fac.wast similarity index 100% rename from ml-proto/test/fac.wast rename to testsuite/fac.wast diff --git a/ml-proto/test/float_exprs.wast b/testsuite/float_exprs.wast similarity index 100% rename from ml-proto/test/float_exprs.wast rename to testsuite/float_exprs.wast diff --git a/ml-proto/test/float_literals.wast b/testsuite/float_literals.wast similarity index 100% rename from ml-proto/test/float_literals.wast rename to testsuite/float_literals.wast diff --git a/ml-proto/test/float_memory.wast b/testsuite/float_memory.wast similarity index 100% rename from ml-proto/test/float_memory.wast rename to testsuite/float_memory.wast diff --git a/ml-proto/test/float_misc.wast b/testsuite/float_misc.wast similarity index 100% rename from ml-proto/test/float_misc.wast rename to testsuite/float_misc.wast diff --git a/ml-proto/test/forward.wast b/testsuite/forward.wast similarity index 100% rename from ml-proto/test/forward.wast rename to testsuite/forward.wast diff --git a/ml-proto/test/i32.wast b/testsuite/i32.wast similarity index 100% rename from ml-proto/test/i32.wast rename to testsuite/i32.wast diff --git a/ml-proto/test/i64.wast b/testsuite/i64.wast similarity index 100% rename from ml-proto/test/i64.wast rename to testsuite/i64.wast diff --git a/ml-proto/test/imports.wast b/testsuite/imports.wast similarity index 100% rename from ml-proto/test/imports.wast rename to testsuite/imports.wast diff --git a/ml-proto/test/int_exprs.wast b/testsuite/int_exprs.wast similarity index 100% rename from ml-proto/test/int_exprs.wast rename to testsuite/int_exprs.wast diff --git a/ml-proto/test/int_literals.wast b/testsuite/int_literals.wast similarity index 100% rename from ml-proto/test/int_literals.wast rename to testsuite/int_literals.wast diff --git a/ml-proto/test/labels.wast b/testsuite/labels.wast similarity index 100% rename from ml-proto/test/labels.wast rename to testsuite/labels.wast diff --git a/ml-proto/test/left-to-right.wast b/testsuite/left-to-right.wast similarity index 100% rename from ml-proto/test/left-to-right.wast rename to testsuite/left-to-right.wast diff --git a/ml-proto/test/memory.wast b/testsuite/memory.wast similarity index 100% rename from ml-proto/test/memory.wast rename to testsuite/memory.wast diff --git a/ml-proto/test/memory_redundancy.wast b/testsuite/memory_redundancy.wast similarity index 100% rename from ml-proto/test/memory_redundancy.wast rename to testsuite/memory_redundancy.wast diff --git a/ml-proto/test/memory_trap.wast b/testsuite/memory_trap.wast similarity index 100% rename from ml-proto/test/memory_trap.wast rename to testsuite/memory_trap.wast diff --git a/ml-proto/test/resizing.wast b/testsuite/resizing.wast similarity index 100% rename from ml-proto/test/resizing.wast rename to testsuite/resizing.wast diff --git a/ml-proto/test/runaway-recursion.wast b/testsuite/runaway-recursion.wast similarity index 100% rename from ml-proto/test/runaway-recursion.wast rename to testsuite/runaway-recursion.wast diff --git a/ml-proto/test/store_retval.wast b/testsuite/store_retval.wast similarity index 100% rename from ml-proto/test/store_retval.wast rename to testsuite/store_retval.wast diff --git a/ml-proto/test/switch.wast b/testsuite/switch.wast similarity index 100% rename from ml-proto/test/switch.wast rename to testsuite/switch.wast diff --git a/ml-proto/test/traps.wast b/testsuite/traps.wast similarity index 100% rename from ml-proto/test/traps.wast rename to testsuite/traps.wast