diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2018-10-02 06:13:44 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-10-04 21:20:57 +0300 |
commit | c0c075c1298ad9018a62d75a632af1c0d0d7d0f8 (patch) | |
tree | cadf15c9de967df71bf047233790d722faf46ff1 /test cases | |
parent | 577d6bfdb483452b2a9434ba3a1d7031094b0cbd (diff) | |
download | meson-c0c075c1298ad9018a62d75a632af1c0d0d7d0f8.zip meson-c0c075c1298ad9018a62d75a632af1c0d0d7d0f8.tar.gz meson-c0c075c1298ad9018a62d75a632af1c0d0d7d0f8.tar.bz2 |
Make custom dist scripts accept arguments.
meson.add_dist_script, introduced in #3906, did not accept any arguments
other than script name. Since all other meson.add_*_script methods
do accept args, this makes the dist script accept them as well.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/unit/35 dist script/meson.build | 2 | ||||
-rwxr-xr-x | test cases/unit/35 dist script/replacer.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test cases/unit/35 dist script/meson.build b/test cases/unit/35 dist script/meson.build index 3415ec4..fd672a9 100644 --- a/test cases/unit/35 dist script/meson.build +++ b/test cases/unit/35 dist script/meson.build @@ -4,4 +4,4 @@ project('dist script', 'c', exe = executable('comparer', 'prog.c') test('compare', exe) -meson.add_dist_script('replacer.py') +meson.add_dist_script('replacer.py', '"incorrect"', '"correct"') diff --git a/test cases/unit/35 dist script/replacer.py b/test cases/unit/35 dist script/replacer.py index adda365..96ccdcc 100755 --- a/test cases/unit/35 dist script/replacer.py +++ b/test cases/unit/35 dist script/replacer.py @@ -2,11 +2,15 @@ import os import pathlib +import sys + +if len(sys.argv) < 3: + sys.exit('usage: replacer.py <pattern> <replacement>') source_root = pathlib.Path(os.environ['MESON_DIST_ROOT']) modfile = source_root / 'prog.c' contents = modfile.read_text() -contents = contents.replace('"incorrect"', '"correct"') +contents = contents.replace(sys.argv[1], sys.argv[2]) modfile.write_text(contents) |