git: 6afb2b8e2fa7 - stable/15 - tests/exterr_test: use ATF_REQUIRE_FEATURE to check exterr_strings

Alexander Leidinger <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a687f2a.201ab.5359f62__32389.1838941321$1785233219$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by netchild:

URL: https://cgit.FreeBSD.org/src/commit/?id=6afb2b8e2fa7608b9e3e3ec2035319cca00481ce

commit 6afb2b8e2fa7608b9e3e3ec2035319cca00481ce
Author:     Siva Mahadevan <[email protected]>
AuthorDate: 2026-07-22 01:27:11 +0000
Commit:     Alexander Leidinger <[email protected]>
CommitDate: 2026-07-28 10:04:53 +0000

    tests/exterr_test: use ATF_REQUIRE_FEATURE to check exterr_strings
    
    This keeps the skipped test message consistent with others.
    
    Reviewed by:    netchild
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 3e946566c134e039f9c777eaa1232a32e383692c)
---
 tests/sys/kern/Makefile      | 2 ++
 tests/sys/kern/exterr_test.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile
index ab68fbf11a6e..2fc9a9b2aca3 100644
--- a/tests/sys/kern/Makefile
+++ b/tests/sys/kern/Makefile
@@ -154,6 +154,8 @@ SRCS.subr_physmem_test+= subr_physmem_test.c subr_physmem.c
 CFLAGS.subr_unit.c+=	-Wno-missing-prototypes
 SRCS.subr_unit_test+=	subr_unit.c
 
+CFLAGS.exterr_test+=	-I${SRCTOP}/tests
+
 WARNS?=	3
 
 TESTS_SUBDIRS+=	acct
diff --git a/tests/sys/kern/exterr_test.c b/tests/sys/kern/exterr_test.c
index 316b5b66b0e0..bde7654fecfc 100644
--- a/tests/sys/kern/exterr_test.c
+++ b/tests/sys/kern/exterr_test.c
@@ -34,6 +34,8 @@
 #include <string.h>
 #include <unistd.h>
 
+#include "freebsd_test_suite/macros.h"
+
 /*
  * Pin the message format by clearing EXTERROR_VERBOSE, which would
  * otherwise change the output shape.
@@ -66,8 +68,7 @@ ATF_TC_BODY(gettext_extended, tc)
 	r = uexterr_gettext(exterr, sizeof(exterr));
 	ATF_CHECK_EQ(0, r);
 	printf("Extended error: %s\n", exterr);
-	if (feature_present("exterr_strings") == 0)
-		atf_tc_skip("kernel built without EXTERR_STRINGS");
+	ATF_REQUIRE_FEATURE("exterr_strings");
 	/* Note: error string may need to be updated due to kernel changes */
 	ATF_CHECK(strstr(exterr, " is not subset of ") != NULL);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.