diff options
author | Thomas Lively <tlively@google.com> | 2021-06-17 10:30:06 -0700 |
---|---|---|
committer | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2021-06-17 14:35:56 -0400 |
commit | 8de4349ebdb6ce398ef4939f9f375a7413d99b09 (patch) | |
tree | cbe1e20501cee9eabc63683846cee4d466732fd7 /test/lit/lit.cfg.py | |
parent | acdea58d62079c1477eb35f460741908063ec26a (diff) | |
download | binaryen-8de4349ebdb6ce398ef4939f9f375a7413d99b09.tar.gz binaryen-8de4349ebdb6ce398ef4939f9f375a7413d99b09.tar.bz2 binaryen-8de4349ebdb6ce398ef4939f9f375a7413d99b09.zip |
Add a `foreach` script for use in lit tests
The major drawback of lit tests is that so far they have only supported a single
module per test file. This commit adds a new utility script that splits an input
file into multiple files and runs a command on each of them, giving lit tests a
simple way to test multiple modules per file.
Diffstat (limited to 'test/lit/lit.cfg.py')
-rw-r--r-- | test/lit/lit.cfg.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/lit/lit.cfg.py b/test/lit/lit.cfg.py index 60ba1ced6..bc034b349 100644 --- a/test/lit/lit.cfg.py +++ b/test/lit/lit.cfg.py @@ -15,7 +15,8 @@ for tool_file in os.listdir(bin_dir): 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.binaryen_src_root + '/scripts/not.py' -python = sys.executable.replace('\\', '/') -config.substitutions.append(('not', python + ' ' + not_file)) +# Also make the `not` and `foreach` commands available +for tool in ('not', 'foreach'): + tool_file = config.binaryen_src_root + '/scripts/' + tool + '.py' + python = sys.executable.replace('\\', '/') + config.substitutions.append((tool, python + ' ' + tool_file)) |