summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-12-09 13:50:41 -0800
committerGitHub <noreply@github.com>2020-12-09 13:50:41 -0800
commit64d2aef103ce19f280cff34e5a60f5035cacaa29 (patch)
tree7b103627b87e9bcc06110c0a60fda243a1668085 /scripts
parent823222ff566b38495327bc28b4726871b0a86b26 (diff)
downloadbinaryen-64d2aef103ce19f280cff34e5a60f5035cacaa29.tar.gz
binaryen-64d2aef103ce19f280cff34e5a60f5035cacaa29.tar.bz2
binaryen-64d2aef103ce19f280cff34e5a60f5035cacaa29.zip
Improve lit support (#3426)
This uses the same technique used in llvm-lit to enable running on in-tree tests with out-of-tree builds. So you can run something like this: ../binaryen-out/bin/binaryen-lit test/lit/
Diffstat (limited to 'scripts')
-rwxr-xr-x[-rw-r--r--]scripts/binaryen-lit.in (renamed from scripts/lit_wrapper.py)17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/lit_wrapper.py b/scripts/binaryen-lit.in
index 19473b52f..f26540bc3 100644..100755
--- a/scripts/lit_wrapper.py
+++ b/scripts/binaryen-lit.in
@@ -14,9 +14,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import os
from lit.main import main
-# A simple wrapper around `lit`'s main function, since it isn't otherwise
-# exposed.
+# A simple wrapper around `lit` test running. Loosely based on
+# llvm's llvm-lit script
+
+builtin_parameters = {
+ 'config_map': {
+ os.path.normcase(os.path.normpath('@CMAKE_SOURCE_DIR@/test/lit/lit.cfg.py')):
+ os.path.normcase(os.path.normpath('@CMAKE_BINARY_DIR@/test/lit/lit.site.cfg.py'))
+ }
+}
+
+print(builtin_parameters)
+
if __name__ == '__main__':
- main()
+ main(builtin_parameters)