DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harry van Haaren <harry.van.haaren@intel.com>
To: dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com, bruce.richardson@intel.com,
	Harry van Haaren <harry.van.haaren@intel.com>
Subject: [dpdk-dev] [PATCH v2 2/3] test: add skipped return result
Date: Thu, 11 Jan 2018 17:50:34 +0000	[thread overview]
Message-ID: <1515693035-35419-2-git-send-email-harry.van.haaren@intel.com> (raw)
In-Reply-To: <1515693035-35419-1-git-send-email-harry.van.haaren@intel.com>

This commit allows a test to return "skipped", indicating
that it cannot be run. This is useful for PMDs which have
not been compiled due to the unavailability of dependencies,
or their explicit disabling in the build configuration.

The result printing is updated to correctly indicate if a
test has been skipped.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

---

v2:
- Re-split patch into two, rewording titles check-git-log (Pablo)
- Add check for "Skipped" tests to not print "Failed" (Pablo)
---
 test/test/commands.c | 2 ++
 test/test/test.h     | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/test/commands.c b/test/test/commands.c
index 6649cfc..0473dac 100644
--- a/test/test/commands.c
+++ b/test/test/commands.c
@@ -106,6 +106,8 @@ static void cmd_autotest_parsed(void *parsed_result,
 	last_test_result = ret;
 	if (ret == 0)
 		printf("Test OK\n");
+	else if (ret == TEST_SKIPPED)
+		printf("Test Skipped\n");
 	else
 		printf("Test Failed\n");
 	fflush(stdout);
diff --git a/test/test/test.h b/test/test/test.h
index ae88a70..a8f765a 100644
--- a/test/test/test.h
+++ b/test/test/test.h
@@ -11,8 +11,9 @@
 #include <rte_common.h>
 #include <rte_log.h>
 
-#define TEST_SUCCESS  (0)
-#define TEST_FAILED  (-1)
+#define TEST_SUCCESS EXIT_SUCCESS
+#define TEST_FAILED  -1
+#define TEST_SKIPPED  77
 
 /* Before including test.h file you can define
  * TEST_TRACE_FAILURE(_file, _line, _func) macro to better trace/debug test
-- 
2.7.4

  reply	other threads:[~2018-01-11 17:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21 12:07 [dpdk-dev] [PATCH 1/2] test: use env variable to run tests Harry van Haaren
2017-12-21 12:07 ` [dpdk-dev] [PATCH 2/2] test: add skip instead of fail, update crypto test Harry van Haaren
2018-01-11 16:33   ` De Lara Guarch, Pablo
2018-01-11 16:21 ` [dpdk-dev] [PATCH 1/2] test: use env variable to run tests De Lara Guarch, Pablo
2018-01-11 17:50 ` [dpdk-dev] [PATCH v2 1/3] " Harry van Haaren
2018-01-11 17:50   ` Harry van Haaren [this message]
2018-01-11 18:01     ` [dpdk-dev] [PATCH v2 2/3] test: add skipped return result De Lara Guarch, Pablo
2018-01-11 17:50   ` [dpdk-dev] [PATCH v2 3/3] test: update cryptodev tests with skipped value Harry van Haaren
2018-01-11 18:01     ` De Lara Guarch, Pablo
2018-01-17 23:05   ` [dpdk-dev] [PATCH v2 1/3] test: use env variable to run tests Thomas Monjalon

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=1515693035-35419-2-git-send-email-harry.van.haaren@intel.com \
    --to=harry.van.haaren@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.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).