aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-12-06 13:21:33 +0100
committerOle Tr�an <otroan@employees.org>2021-12-06 13:11:10 +0000
commit68843d1b6ce52315f8a3567537a3cb246c1ecf40 (patch)
treebe3373818cf6e74f7c7aa0f52d3220f127f81832 /src/vppinfra
parentde3735f82862e5c3997550e6a5bcbf5adbfbba40 (diff)
vppinfra: add 'filter' option to test_vector_funcs
Type: improvement Change-Id: I5ed9029e5dc1368b7debbef04a3ac439a61af9ea Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/vector/test/test.c9
-rw-r--r--src/vppinfra/vector/test/test.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/vppinfra/vector/test/test.c b/src/vppinfra/vector/test/test.c
index d098766481c..144604e5fcd 100644
--- a/src/vppinfra/vector/test/test.c
+++ b/src/vppinfra/vector/test/test.c
@@ -35,6 +35,8 @@ test_funct (test_main_t *tm)
while (r)
{
clib_error_t *err;
+ if (tm->filter && strstr (r->name, (char *) tm->filter) == 0)
+ goto next;
err = (r->fn) (0);
fformat (stdout, "%-50s %s\n", r->name, err ? "FAIL" : "PASS");
if (err)
@@ -42,7 +44,7 @@ test_funct (test_main_t *tm)
clib_error_report (err);
fformat (stdout, "\n");
}
-
+ next:
r = r->next;
}
}
@@ -161,6 +163,8 @@ test_perf (test_main_t *tm)
if (r->perf_tests)
{
test_perf_t *pt = r->perf_tests;
+ if (tm->filter && strstr (r->name, (char *) tm->filter) == 0)
+ goto next;
fformat (stdout, "%-22s%-12s%U\n", r->name, "OpType",
b->format_fn, b, pt, 0UL);
do
@@ -190,6 +194,7 @@ test_perf (test_main_t *tm)
}
while ((++pt)->fn);
}
+ next:
r = r->next;
}
}
@@ -220,6 +225,8 @@ main (int argc, char *argv[])
{
if (unformat (i, "perf"))
perf = 1;
+ else if (unformat (i, "filter %s", &tm->filter))
+ ;
else if (unformat (i, "repeat %d", &tm->repeat))
;
else
diff --git a/src/vppinfra/vector/test/test.h b/src/vppinfra/vector/test/test.h
index 5b26996551b..16622877c45 100644
--- a/src/vppinfra/vector/test/test.h
+++ b/src/vppinfra/vector/test/test.h
@@ -53,6 +53,7 @@ typedef struct
{
test_registration_t *registrations[CLIB_MARCH_TYPE_N_VARIANTS];
u32 repeat;
+ u8 *filter;
} test_main_t;
extern test_main_t test_main;