diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-10-15 15:52:05 +0100 |
---|---|---|
committer | Dan Kegel <dank@kegel.com> | 2020-06-05 14:15:26 -0700 |
commit | 702d03e426b76c5a8cb86389f4507aea43a9a35b (patch) | |
tree | dc1716448b0f5d2bce7e37a7065c6a75399045ed /test cases/common | |
parent | c61f75adbfd5b2ce18de329e65217cc911f989d4 (diff) | |
download | meson-702d03e426b76c5a8cb86389f4507aea43a9a35b.zip meson-702d03e426b76c5a8cb86389f4507aea43a9a35b.tar.gz meson-702d03e426b76c5a8cb86389f4507aea43a9a35b.tar.bz2 |
Add a test case for very long command lines
This exercises commands of about 20K in length
Also test short commandlines to make sure they don't regress.
Diffstat (limited to 'test cases/common')
4 files changed, 38 insertions, 0 deletions
diff --git a/test cases/common/234 very long commmand line/codegen.py b/test cases/common/234 very long commmand line/codegen.py new file mode 100755 index 0000000..4de78ce --- /dev/null +++ b/test cases/common/234 very long commmand line/codegen.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys + +with open(sys.argv[2], 'w') as f: + print('int func{n}(void) {{ return {n}; }}'.format(n=sys.argv[1]), file=f) diff --git a/test cases/common/234 very long commmand line/main.c b/test cases/common/234 very long commmand line/main.c new file mode 100644 index 0000000..dbb64a8 --- /dev/null +++ b/test cases/common/234 very long commmand line/main.c @@ -0,0 +1,5 @@ +int main(int argc, char **argv) { + (void) argc; + (void) argv; + return 0; +} diff --git a/test cases/common/234 very long commmand line/meson.build b/test cases/common/234 very long commmand line/meson.build new file mode 100644 index 0000000..7a316e1 --- /dev/null +++ b/test cases/common/234 very long commmand line/meson.build @@ -0,0 +1,21 @@ +project('very long command lines', 'c') + +seq = run_command('seq.py', '1', '256').stdout().strip().split('\n') + +sources = [] +codegen = find_program('codegen.py') + +foreach i : seq + sources += custom_target('codegen' + i, + command: [codegen, i, '@OUTPUT@'], + output: 'test' + i + '.c') +endforeach + +shared_library('sharedlib', sources) +static_library('staticlib', sources) +executable('app', 'main.c', sources) + +# Also test short commandlines to make sure that doesn't regress +shared_library('sharedlib0', sources[0]) +static_library('staticlib0', sources[0]) +executable('app0', 'main.c', sources[0]) diff --git a/test cases/common/234 very long commmand line/seq.py b/test cases/common/234 very long commmand line/seq.py new file mode 100755 index 0000000..637bf57 --- /dev/null +++ b/test cases/common/234 very long commmand line/seq.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys + +for i in range(int(sys.argv[1]), int(sys.argv[2])): + print(i) |