diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-18 17:11:57 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-27 23:35:29 +0300 |
| commit | fb770e1e3d17d548c34817001733f2a13f24ce9f (patch) | |
| tree | 7e9bf40d6ff7cc23256ec913fb831b35be126906 /test cases | |
| parent | 1ffc8de5e8cc79dbaa54fd1ac02b6b4c5edac7a1 (diff) | |
| download | meson-fb770e1e3d17d548c34817001733f2a13f24ce9f.tar.gz | |
Add support for custom dist scripts.
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/unit/35 dist script/meson.build | 7 | ||||
| -rw-r--r-- | test cases/unit/35 dist script/prog.c | 7 | ||||
| -rwxr-xr-x | test cases/unit/35 dist script/replacer.py | 12 |
3 files changed, 26 insertions, 0 deletions
diff --git a/test cases/unit/35 dist script/meson.build b/test cases/unit/35 dist script/meson.build new file mode 100644 index 000000000..3415ec483 --- /dev/null +++ b/test cases/unit/35 dist script/meson.build @@ -0,0 +1,7 @@ +project('dist script', 'c', + version : '1.0.0') + +exe = executable('comparer', 'prog.c') +test('compare', exe) + +meson.add_dist_script('replacer.py') diff --git a/test cases/unit/35 dist script/prog.c b/test cases/unit/35 dist script/prog.c new file mode 100644 index 000000000..1bb6b053e --- /dev/null +++ b/test cases/unit/35 dist script/prog.c @@ -0,0 +1,7 @@ +#include<string.h> + +#define REPLACEME "incorrect" + +int main(int argc, char **argv) { + return strcmp(REPLACEME, "correct"); +} diff --git a/test cases/unit/35 dist script/replacer.py b/test cases/unit/35 dist script/replacer.py new file mode 100755 index 000000000..92bcef0d3 --- /dev/null +++ b/test cases/unit/35 dist script/replacer.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import os, sys +import pathlib + +source_root = pathlib.Path(os.environ['MESON_DIST_ROOT']) + +modfile = source_root / 'prog.c' + +contents = modfile.read_text() +contents = contents.replace('"incorrect"', '"correct"') +modfile.write_text(contents) |
