From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Alexandru Copot <alex.mihai.c@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, willemb@google.com,
dborkman@redhat.com, edumazet@google.com,
Daniel Baluta <dbaluta@ixiacom.com>
Subject: Re: [PATCH 1/3 net-next RFC] selftest: add abstractions for net selftests
Date: Tue, 09 Apr 2013 17:39:21 +0400 [thread overview]
Message-ID: <51641A09.7040108@cogentembedded.com> (raw)
In-Reply-To: <1365503461-26309-2-git-send-email-alex.mihai.c@gmail.com>
Hello.
On 09-04-2013 14:30, Alexandru Copot wrote:
> Signed-of by Alexandru Copot <alex.mihai.c@gmail.com>
> Cc: Daniel Baluta <dbaluta@ixiacom.com>
[...]
> diff --git a/tools/testing/selftests/net/selftests.c b/tools/testing/selftests/net/selftests.c
> new file mode 100644
> index 0000000..cd6e427
> --- /dev/null
> +++ b/tools/testing/selftests/net/selftests.c
> @@ -0,0 +1,30 @@
> +#include <stdio.h>
> +
> +#include "selftests.h"
> +
> +int run_all_tests(struct generic_test *test, void *param)
> +{
> + int i;
> + int rc, allrc;
> + char *ptr;
> +
> + rc = test->prepare ? test->prepare(param) : 0;
> + if (rc)
> + return rc;
> +
> + allrc = 0;
> + printf("Testing: %s ", test->name);
> + ptr = test->testcases;
> + for (i = 0; i < test->testcase_count; i++) {
> + rc = test->run(ptr);
> + allrc |= rc;
> +
> + if (test->abort_on_fail && rc) {
> + printf("Testcase %d failed, aborting\n", i);
> + }
Nit: {} not needed here, at least if you folow the Linux coding style (you
seem to).
WBR, Sergei
next prev parent reply other threads:[~2013-04-09 13:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 10:30 [PATCH 0/3 net-next RFC] selftest: Introduce test abstraction for net Alexandru Copot
2013-04-09 10:30 ` [PATCH 1/3 net-next RFC] selftest: add abstractions for net selftests Alexandru Copot
2013-04-09 11:13 ` Daniel Borkmann
2013-04-09 11:24 ` Alexandru Copot
2013-04-09 11:32 ` Daniel Borkmann
2013-04-09 13:39 ` Sergei Shtylyov [this message]
2013-04-09 13:54 ` Daniel Borkmann
2013-04-09 10:31 ` [PATCH 2/3 net-next RFC] selftest: Adapt socket test to new testing framework Alexandru Copot
2013-04-09 10:31 ` [PATCH net-next RFC] selftests: add socket options test with IPv6 testcases Alexandru Copot
2013-04-09 11:22 ` [PATCH 0/3 net-next RFC] selftest: Introduce test abstraction for net Daniel Borkmann
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=51641A09.7040108@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=alex.mihai.c@gmail.com \
--cc=davem@davemloft.net \
--cc=dbaluta@ixiacom.com \
--cc=dborkman@redhat.com \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=willemb@google.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 NNTP newsgroup(s).