From 702d03e426b76c5a8cb86389f4507aea43a9a35b Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Mon, 15 Oct 2018 15:52:05 +0100 Subject: 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. --- .../common/234 very long commmand line/codegen.py | 6 ++++++ .../common/234 very long commmand line/main.c | 5 +++++ .../common/234 very long commmand line/meson.build | 21 +++++++++++++++++++++ .../common/234 very long commmand line/seq.py | 6 ++++++ 4 files changed, 38 insertions(+) create mode 100755 test cases/common/234 very long commmand line/codegen.py create mode 100644 test cases/common/234 very long commmand line/main.c create mode 100644 test cases/common/234 very long commmand line/meson.build create mode 100755 test cases/common/234 very long commmand line/seq.py (limited to 'test cases/common') 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) -- cgit v1.1