From 56d48389d883f56a0ac017885dc6ad25dab5bc91 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 22 Nov 2019 15:00:38 -0500 Subject: [PATCH] tests: gen-ust-events: abort() on argument error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Facilitates test transition: quickly identify tests which were not updated. Signed-off-by: Mathieu Desnoyers Change-Id: Idec886cc565c4cb7f1de89e7f3f765c882f4b988 Signed-off-by: Jérémie Galarneau --- tests/utils/testapp/gen-ust-events/gen-ust-events.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/utils/testapp/gen-ust-events/gen-ust-events.c b/tests/utils/testapp/gen-ust-events/gen-ust-events.c index 353523b7c..8f2acdbab 100644 --- a/tests/utils/testapp/gen-ust-events/gen-ust-events.c +++ b/tests/utils/testapp/gen-ust-events/gen-ust-events.c @@ -109,6 +109,17 @@ int main(int argc, char **argv) if (optind != argc) { fprintf(stderr, "Error: takes long options only.\n"); + + /* + * Aborting the test program for now because callers typically don't check + * the test program return value, and the transition from positional + * arguments to getopt causes hangs when caller scripts are not updated. + * An abort is easier to diagnose and fix. This is a temporary solution: + * we should eventually ensure that all scripts test and report the test + * app return values. + */ + abort(); + ret = -1; goto end; } -- 2.34.1