public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: sellcey@cavium.com
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] Document do_test in test-skeleton.c
Date: Mon, 07 Nov 2016 14:51:00 -0000	[thread overview]
Message-ID: <df9001e1-bb47-b77f-7451-7e24caa2fb07@redhat.com> (raw)
In-Reply-To: <201611042247.uA4Ml39C014721@sellcey-lt.caveonetworks.com>

On 11/04/2016 11:47 PM, Steve Ellcey wrote:
> While working on a patch for math/test-tgmath2.c I learned some information
> about do_test and how it should work.  Here is my attempt to put that
> information into test-skeleton.c.  If it looks accurate I could put this
> information in the GLIBC Wiki too, in the "Writing a test case" section.
> The comments about writing to stdout instead of stderr is already in the Wiki,
> but the return value descriptions are not.
>
> Steve Ellcey
> sellcey@caviumnetworks.com
>
>
>
> 2016-11-04  Steve Ellcey  <sellcey@caviumnetworks.com>
>
> 	* test-skeleton.c: Document do_test usage.
>
>
> diff --git a/test-skeleton.c b/test-skeleton.c
> index 55841fb..cbd0c2d 100644
> --- a/test-skeleton.c
> +++ b/test-skeleton.c
> @@ -36,7 +36,22 @@
>
>  /* The test function is normally called `do_test' and it is called
>     with argc and argv as the arguments.  We nevertheless provide the
> -   possibility to overwrite this name.  */
> +   possibility to overwrite this name.
> +
> +   The test function should have a return type of 'int' and should

Perhaps “The TEST_FUNCTION expression should have type 'int'”?

TEST_FUNCTION is an expression, not the name of a function

> +   return 0 to indicate a passing test, 1 to indicate a failing test,
> +   or 77 to indicate an unsupported test.  Other result values could be
> +   used to indicate a failing test but since the result of the test

Comma before “but”?

> +   function is passed to exit and exit only returns the lower 8 bits of
> +   its input a non-zero return with some values could cause a test to
> +   incorrectly be considered passing when it really failed. For this
> +   reason tests should always return 0, 1, or 77.
> +
> +   The test function may print out diagnostic or warning messages as well
> +   as messages about failures.  These messages should be printed to stdout
> +   and not stderr so that the output is properly ordered with respect to
> +   the rest of the glibc testsuite run output.  */

Rest looks good to me.

Thanks,
Florian

      reply	other threads:[~2016-11-07 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04 22:47 Steve Ellcey
2016-11-07 14:51 ` Florian Weimer [this message]

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=df9001e1-bb47-b77f-7451-7e24caa2fb07@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=sellcey@cavium.com \
    /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).