summaryrefslogtreecommitdiff
path: root/test/lit/lit.cfg.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/lit.cfg.py')
-rw-r--r--test/lit/lit.cfg.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lit/lit.cfg.py b/test/lit/lit.cfg.py
new file mode 100644
index 000000000..91dc1aeff
--- /dev/null
+++ b/test/lit/lit.cfg.py
@@ -0,0 +1,21 @@
+import lit.formats
+
+config.name = "Binaryen lit tests"
+config.test_format = lit.formats.ShTest(True)
+
+config.suffixes = ['.wat', '.wast']
+
+config.test_source_root = os.path.dirname(__file__)
+config.test_exec_root = os.path.join(config.src_root, 'out', 'test')
+
+# Replace all Binaryen tools with their absolute paths
+bin_dir = os.path.join(config.binaryen_root, 'bin')
+for tool_file in os.listdir(bin_dir):
+ tool_path = config.binaryen_root + '/bin/' + tool_file
+ tool = tool_file[:-4] if tool_file.endswith('.exe') else tool_file
+ config.substitutions.append((tool, tool_path))
+
+# Also make the `not` command available
+not_file = config.src_root + '/scripts/not.py'
+python = sys.executable.replace('\\', '/')
+config.substitutions.append(('not', python + ' ' + not_file))