diff options
| author | Siva Mahadevan <siva@FreeBSD.org> | 2026-07-22 01:27:11 +0000 |
|---|---|---|
| committer | Siva Mahadevan <siva@FreeBSD.org> | 2026-07-22 13:40:53 +0000 |
| commit | 3e946566c134e039f9c777eaa1232a32e383692c (patch) | |
| tree | 8c60f5460251bcdbd5fa6b83b14b354813dabb6f | |
| parent | afbb7dc0a51e4d4c227bdf00770d1ad821cf9889 (diff) | |
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
| -rw-r--r-- | tests/sys/kern/Makefile | 2 | ||||
| -rw-r--r-- | 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 f7f5d1825e01..f025172c8388 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -153,6 +153,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); } |
