From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] tst_test: Add option parsing helpers.
Date: Thu, 4 Aug 2016 03:37:40 -0400 (EDT) [thread overview]
Message-ID: <261930823.1019774.1470296260665.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160803145925.GA31921@rei.lan>
----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: ltp@lists.linux.it
> Cc: "Jan Stancek" <jstancek@redhat.com>
> Sent: Wednesday, 3 August, 2016 4:59:25 PM
> Subject: [PATCH] tst_test: Add option parsing helpers.
>
> Add two helpers for parsing integers and floags, these are intended to
> be used in the test setup to parse options from struct tst_option.
>
> static char *str_threads;
> static int threads;
> ...
>
> static struct tst_options[] = {
> {"t:", &str_threads, "Number of threads"},
> ...
> {NULL, NULL, NULL}
> };
>
> static void setup(void)
> {
> if (tst_parse_int(str_threads, &threads, 1, INT_MAX))
> tst_brk(TBROK, "Invalid number of threads '%s'", str_threads);
>
> ...
> }
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
Looks good to me.
Regards,
Jan
next prev parent reply other threads:[~2016-08-04 7:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 14:59 [LTP] [PATCH] tst_test: Add option parsing helpers Cyril Hrubis
2016-08-04 7:37 ` Jan Stancek [this message]
2016-08-04 10:05 ` Cyril Hrubis
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=261930823.1019774.1470296260665.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/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