summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lit_wrapper.py22
-rwxr-xr-xscripts/not.py30
-rw-r--r--scripts/test/lld.py2
-rw-r--r--scripts/test/shared.py7
4 files changed, 57 insertions, 4 deletions
diff --git a/scripts/lit_wrapper.py b/scripts/lit_wrapper.py
new file mode 100644
index 000000000..19473b52f
--- /dev/null
+++ b/scripts/lit_wrapper.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+#
+# Copyright 2020 WebAssembly Community Group participants
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from lit.main import main
+
+# A simple wrapper around `lit`'s main function, since it isn't otherwise
+# exposed.
+if __name__ == '__main__':
+ main()
diff --git a/scripts/not.py b/scripts/not.py
new file mode 100755
index 000000000..98898f451
--- /dev/null
+++ b/scripts/not.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python3
+
+# Copyright 2020 WebAssembly Community Group participants
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+import subprocess
+
+
+# Emulate the `not` tool from LLVM's test infrastructure for use with lit and
+# FileCheck. It succeeds if the given subcommand fails and vice versa.
+def main():
+ cmd = sys.argv[1:]
+ result = subprocess.run(cmd)
+ sys.exit(0 if result.returncode != 0 else 1)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/scripts/test/lld.py b/scripts/test/lld.py
index 5732f7332..328339287 100644
--- a/scripts/test/lld.py
+++ b/scripts/test/lld.py
@@ -26,8 +26,6 @@ def args_for_finalize(filename):
ret += ['--side-module']
if 'standalone-wasm' in filename:
ret += ['--standalone-wasm']
- if 'bigint' in filename:
- ret += ['--bigint']
return ret
diff --git a/scripts/test/shared.py b/scripts/test/shared.py
index 720ad2aa9..dcb52b3fe 100644
--- a/scripts/test/shared.py
+++ b/scripts/test/shared.py
@@ -50,8 +50,9 @@ def parse_args(args):
' earlier errors.'))
parser.add_argument(
'--binaryen-bin', dest='binaryen_bin', default='',
- help=('Specifies a path to where the built Binaryen executables reside at.'
- ' Default: bin/ of current directory (i.e. assume an in-tree build).'
+ help=('Specifies the path to the Binaryen executables in the CMake build'
+ ' directory. Default: bin/ of current directory (i.e. assume an'
+ ' in-tree build).'
' If not specified, the environment variable BINARYEN_ROOT= can also'
' be used to adjust this.'))
parser.add_argument(
@@ -129,6 +130,8 @@ if not options.binaryen_lib:
options.binaryen_lib = os.path.normpath(os.path.abspath(options.binaryen_lib))
+options.binaryen_build = os.path.dirname(options.binaryen_bin)
+
# ensure BINARYEN_ROOT is set up
os.environ['BINARYEN_ROOT'] = os.path.dirname(options.binaryen_bin)