lib: Add known-fail test tag
PATCH v2 1/2 lib: Add known-fail test tag
to save test reviewers time.
Suggested-by Cyril Hrubis <[email protected]>
Signed-off-by Petr Vorel <[email protected]>
---
changes v1->v2:
* fix docparse/testinfo.pl
doc/c-test-api.txt | 1 + docparse/testinfo.pl | 11 ++++++++++- lib/tst_test.c | 8 ++++++-- 3 files changed, 17 insertions(+), 3 deletions(-)
doc/c-test-api.txt +1 -0
@@ -2259,6 +2259,7 @@ struct tst_test test = { .tags = (const struct tst_tag[]) { {"linux-git", "9392a27d88b9"}, {"linux-git", "ff002b30181d"}, + {"known-fail", "ustat() is known to fail with EINVAL on Btrfs"}, {"linux-stable-git", "c4a23c852e80"}, {"CVE", "2020-29373"}, {}
docparse/testinfo.pl +10 -1
@@ -74,6 +74,10 @@ sub tag_url { return eval("main::$key") . $value; } + if ('known-fail') { + return ''; + } + die("unknown constant '$key' for tag $tag, define it!"); }
@@ -432,6 +436,7 @@ sub content_all_tests } my $k = @$tag[0]; my $v = @$tag[1]; + my $url; if (defined($$git_url{$k})) { $commits{$k} = () unless (defined($commits{$k}));
@@ -443,7 +448,11 @@ sub content_all_tests $v .= ' ("' . $commits{$k}{$v} . '")'; } - $v = html_a(tag_url($k, @$tag[1]), $v); + $url = tag_url($k, @$tag[1]); + if ($url) { + $v = html_a($url, $v); + } + $content .= "\n|" . reference($k) . "\n|$v\n"; $tmp2 = 1; }
lib/tst_test.c +6 -2
@@ -762,10 +762,13 @@ static void print_failure_hint(const char *tag, const char *hint, hint_printed =1 ;fprintf (stderr,"\n" );print_colored ("HINT: " ); -fprintf (stderr,"You _MAY_ be %s, see:\n\n" , hint); +fprintf (stderr,"You _MAY_ be %s:\n\n" , hint); } -fprintf (stderr,"%s%s\n" , url, tags[i].value); +if (url) +fprintf (stderr,"%s%s\n" , url, tags[i].value); +else +fprintf (stderr,"%s\n" , tags[i].value); } } }
@@ -778,6 +781,7 @@ static void print_failure_hints(void) LINUX_STABLE_GIT_URL);print_failure_hint ("glibc-git" ,"missing glibc fixes" ,GLIBC_GIT_URL );print_failure_hint ("CVE" ,"vulnerable to CVE(s)" ,CVE_DB_URL ); +print_failure_hint ("known-fail" ,"hit by known kernel failures" ,NULL ); }static void do_exit (int ret)
Signature · 5 lines
2.34.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp