public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Joe Simmons-Talbott <josimmon@redhat.com>, libc-alpha@sourceware.org
Cc: Joe Talbott <joetalbott@gmail.com>
Subject: Re: [PATCH] math: Add LIBM_TEST_VERBOSE environment variable support.
Date: Wed, 8 May 2024 09:28:53 -0400	[thread overview]
Message-ID: <98733f1b-b6af-4c3a-8c5d-140a4ad06eca@redhat.com> (raw)
In-Reply-To: <20240507003441.4080835-1-josimmon@redhat.com>

On 5/6/24 20:34, Joe Simmons-Talbott wrote:
> From: Joe Talbott <joetalbott@gmail.com>
> 
> Allow the libm-test-driver based tests to have their verbosity set based
> on the LIMB_TESt_VERBOSE environment variable.  This allows the entire

s/LIMB_TESt_VERBOSE/LIBM_TEST_VERBOSE/g

Please call it GLIBC_TEST_LIBM_VERBOSE.

We should really use a known conventional prefix e.g. GLIBC_TEST.

We don't currently, but lets move in that direction.

At worse I see WAIT_FOR_DEBUGGER, PID_OUTSIDE_CONTAINER, TIMEOUTFACTOR,
TEST_DIRECT and TEST_COREDUMPS, which could all get cleaned up.

> testsuite to be run with a non-default verbosity.
> ---
>  math/libm-test-support.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/math/libm-test-support.c b/math/libm-test-support.c
> index 1d60ac783b..a45686054f 100644
> --- a/math/libm-test-support.c
> +++ b/math/libm-test-support.c
> @@ -1139,6 +1139,7 @@ libm_test_init (int argc, char **argv)
>    int remaining;
>    char *ulps_file_path;
>    size_t dir_len = 0;
> +  char *verbose_env;
>  
>    verbose = 1;
>    output_ulps = 0;
> @@ -1148,6 +1149,10 @@ libm_test_init (int argc, char **argv)
>    /* XXX set to 0 for releases.  */
>    ignore_max_ulp = 0;
>  
> +  verbose_env = getenv("LIBM_TEST_VERBOSE");

Adjust as above.

> +  if (verbose_env != NULL)
> +    verbose = (unsigned int) strtoul (verbose_env, NULL, 0);

What happens if this conversion fails?

Please see how we do this with TIMEOUTFACOR:

326   /* If set, read the test TIMEOUTFACTOR value from the environment.
327      This value is used to scale the default test timeout values. */
328   char *envstr_timeoutfactor = getenv ("TIMEOUTFACTOR");
329   if (envstr_timeoutfactor != NULL)
330     {
331       char *envstr_conv = envstr_timeoutfactor;
332       unsigned long int env_fact;
333 
334       env_fact = strtoul (envstr_timeoutfactor, &envstr_conv, 0);
335       if (*envstr_conv == '\0' && envstr_conv != envstr_timeoutfactor)
336         timeoutfactor = MAX (env_fact, 1);
337     }


> +
>    /* Parse and process arguments.  */
>    argp_parse (&argp, argc, argv, 0, &remaining, NULL);
>  

-- 
Cheers,
Carlos.


  reply	other threads:[~2024-05-08 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07  0:34 Joe Simmons-Talbott
2024-05-08 13:28 ` Carlos O'Donell [this message]
2024-05-09  2:31   ` Joe Simmons-Talbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98733f1b-b6af-4c3a-8c5d-140a4ad06eca@redhat.com \
    --to=carlos@redhat.com \
    --cc=joetalbott@gmail.com \
    --cc=josimmon@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).