summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0006-main.c-Add-option-e-to-exclude-certain-tests-for-exe.patch
blob: 7a4de868cb52fe9f207ab2b58a56969f1ff1f839 (plain) @media only all and (prefers-color-scheme: dark) { .highlight .hll { background-color: #49483e } .highlight .c { color: #75715e } /* Comment */ .highlight .err { color: #960050; background-color: #1e0010 } /* Error */ .highlight .k { color: #66d9ef } /* Keyword */ .highlight .l { color: #ae81ff } /* Literal */ .highlight .n { color: #f8f8f2 } /* Name */ .highlight .o { color: #f92672 } /* Operator */ .highlight .p { color: #f8f8f2 } /* Punctuation */ .highlight .ch { color: #75715e } /* Comment.Hashbang */ .highlight .cm { color: #75715e } /* Comment.Multiline */ .highlight .cp { color: #75715e } /* Comment.Preproc */ .highlight .cpf { color: #75715e } /* Comment.PreprocFile */ .highlight .c1 { color: #75715e } /* Comment.Single */ .highlight .cs { color: #75715e } /* Comment.Special */ .highlight .gd { color: #f92672 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gi { color: #a6e22e } /* Generic.Inserted */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #75715e } /* Generic.Subheading */ .highlight .kc { color: #66d9ef } /* Keyword.Constant */ .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ .highlight .kn { color: #f92672 } /* Keyword.Namespace */ .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ .highlight .kt { color: #66d9ef } /* Keyword.Type */ .highlight .ld { color: #e6db74 } /* Literal.Date */ .highlight .m { color: #ae81ff } /* Literal.Number */ .highlight .s { color: #e6db74 } /* Literal.String */ .highlight .na { color: #a6e22e } /* Name.Attribute */ .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ .highlight .nc { color: #a6e22e } /* Name.Class */ .highlight .no { color: #66d9ef } /* Name.Constant */ .highlight .nd { color: #a6e22e } /* Name.Decorator */ .highlight .ni { color: #f8f8f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae
From 49956f65bb53ea2a2c1b394e5e59ffdfcdcc490f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
Date: Wed, 25 Apr 2018 11:55:03 -0500
Subject: [PATCH 6/7] main.c: Add option (-e) to exclude certain tests for
 execution
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

You can specify a set of ptests to be excluded, it will not fail
if some ptest excluded isn't found in the list of execution.

$ ./ptest-runner -e "hang glibc" -d tests/data

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
---
 main.c  | 38 +++++++++++++++++++++++++++++++++++---
 utils.h |  1 +
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/main.c b/main.c
index 593aff1a1956..83600b7d1b31 100644
--- a/main.c
+++ b/main.c
@@ -19,6 +19,7 @@
  * 	Aníbal Limón <anibal.limon@intel.com>
  */
 
+#include <ctype.h>
 #include <limits.h>
 #include <unistd.h>
 #include <string.h>
@@ -42,8 +43,8 @@
 static inline void
 print_usage(FILE *stream, char *progname)
 {
-	fprintf(stream, "Usage: %s [-d directory] [-l list] [-t timeout] [-x xml-filename]"
-			" [-h] [ptest1 ptest2 ...]\n", progname);
+	fprintf(stream, "Usage: %s [-d directory] [-e exclude] [-l list] [-t timeout]"
+			" [-x xml-filename] [-h] [ptest1 ptest2 ...]\n", progname);
 }
 
 int
@@ -53,6 +54,8 @@ main(int argc, char *argv[])
 	int ptest_num = 0;
 	int i;
 	int rc;
+	int ptest_exclude_num = 0;
+	char *c, *tok;
 
 #ifdef MEMCHECK
 	mtrace();
@@ -62,18 +65,44 @@ main(int argc, char *argv[])
 	struct ptest_options opts;
 
 	opts.directory = strdup(DEFAULT_DIRECTORY);
+	opts.exclude = NULL;
 	opts.list = 0;
 	opts.timeout = DEFAULT_TIMEOUT;
 	opts.ptests = NULL;
 	opts.xml_filename = NULL;
 
-	while ((opt = getopt(argc, argv, "d:lt:x:h")) != -1) {
+	while ((opt = getopt(argc, argv, "d:e:lt:x:h")) != -1) {
 		switch (opt) {
 			case 'd':
 				free(opts.directory);
 				opts.directory = realpath(optarg, NULL);
 				CHECK_ALLOCATION(opts.directory, 1, 1);
 			break;
+			case 'e':
+				c = optarg;
+				ptest_exclude_num = 1;
+
+				while (*c) {
+					if (isspace(*c))
+						ptest_exclude_num++;
+					c++;
+				}
+
+
+				opts.exclude = malloc(ptest_exclude_num * sizeof(char));
+				CHECK_ALLOCATION(opts.exclude, 1, 1);
+
+				i = 0;
+				tok = strtok_r(optarg, " ", &c);
+				opts.exclude[i] = strdup(tok);
+				CHECK_ALLOCATION(opts.exclude[i], 1, 1);
+				i++;
+				while ((tok = strtok_r(NULL, " ", &c)) != NULL) {
+					opts.exclude[i] = strdup(tok);
+					CHECK_ALLOCATION(opts.exclude[i], 1, 1);
+					i++;
+				}
+			break;
 			case 'l':
 				opts.list = 1;
 			break;
@@ -134,6 +163,9 @@ main(int argc, char *argv[])
 		ptest_list_free_all(head);
 	}
 
+	for (i = 0; i < ptest_exclude_num; i++)
+		ptest_list_remove(run, opts.exclude[i], 1);
+
 	rc = run_ptests(run, opts, argv[0], stdout, stderr);
 
 	ptest_list_free_all(run);
diff --git a/utils.h b/utils.h
index 8fa20a8bf621..ee85163ddfff 100644
--- a/utils.h
+++ b/utils.h
@@ -32,6 +32,7 @@
 
 struct ptest_options {
 	char *directory;
+	char **exclude;
 	int list;
 	int timeout;
 	char **ptests;
-- 
2.11.0