The branch stable/14 has been updated by ngie:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=360dd4466ffbb3b15770d597722e7e6cb6673e1e

commit 360dd4466ffbb3b15770d597722e7e6cb6673e1e
Author:     Enji Cooper <[email protected]>
AuthorDate: 2026-12-01 07:00:12 +0000
Commit:     Enji Cooper <[email protected]>
CommitDate: 2026-12-03 23:34:09 +0000

    contrib/atf: update to 0.27.0
    
    This release contains the upstreamed version of the wchar_t macros,
    provided by des@ in https://reviews.freebsd.org/D61616.
    
    MFC after:      1 week
    Merge commit '9e2097a19a9dad81dcd8e7074283b8126464f310'
    
    (cherry picked from commit 704c30247527f46e7dd49e79bf32049436eb85ee)
---
 contrib/atf/COPYING                       |  50 +-
 contrib/atf/NEWS                          |  33 ++
 contrib/atf/atf-c++/atf-c++.3             |  14 +-
 contrib/atf/atf-c/atf-c.3                 |  20 +-
 contrib/atf/atf-c/macros.h                |  36 ++
 contrib/atf/atf-c/macros_test.c           | 197 +++++++-
 contrib/atf/atf-c/tc.c                    |  20 +-
 contrib/atf/atf-sh/atf-check.1            |   2 +-
 contrib/atf/atf-sh/atf-check.cpp          |   2 +-
 contrib/atf/atf-sh/atf_check_test.sh      |  12 +-
 contrib/atf/atf-sh/libatf-sh.subr         |   4 +-
 contrib/atf/atf-sh/libatf-sh/FreeBSD.subr |  24 +
 contrib/atf/atf-sh/libatf-sh/common.subr  | 816 ++++++++++++++++++++++++++++++
 contrib/atf/config.h                      |   9 +-
 14 files changed, 1185 insertions(+), 54 deletions(-)

diff --git a/contrib/atf/COPYING b/contrib/atf/COPYING
index 6552cc35f7d4..e2c278e39ae1 100644
--- a/contrib/atf/COPYING
+++ b/contrib/atf/COPYING
@@ -1,11 +1,21 @@
-Redistribution terms                            Automated Testing Framework
-===========================================================================
+Redistribution terms for the Automated Testing Framework (ATF) project.
+
+## Licensing
+
+The ATF project, at is core, is a) BSD 2-clause licensed and b) the
+copyright is owned by The NetBSD Foundation and The FreeBSD Foundation,
+with some exceptions as noted below and elsewhere.
+
+Some components are contain a BSD 3-clause license and were sponsored by
+Google.
 
+Finally, some sources were obtained from third-party projects and may have
+different licenses from the core ATF project.
 
-License
-*******
+### Main Project License
 
-Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012 The NetBSD Foundation, Inc.
+Copyright (c) 2007-2019 The NetBSD Foundation, Inc.
+Copyright (c) 2020-2026 The FreeBSD Foundation.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -30,8 +40,9 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
+### Google Licensed Code
 
-Copyright 2011, 2012 Google Inc.
+Copyright 2010, 2011, 2014 Google Inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -60,9 +71,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
-
-Relicensed code
-***************
+### Relicensed code
 
 The following code snippets have been taken from other projects.  Even
 though they were not originally licensed under the terms above, the
@@ -75,18 +84,6 @@ clarify this fact.
 
   Author: Julio Merino <[email protected]>
 
-* atf-c/ui.c: The format_paragraph and format_text functions were
-  derived form the ones in the Monotone project, revision
-  3a0982da308228d796df35f98d787c5cff2bb5b6.
-
-  Author: Julio Merino <[email protected]>
-
-* atf-c++/detail/io.hpp, atf-c++/detail/io.cpp, atf-c++/detail/io_test.cpp:
-  These files were derived from the file_handle, systembuf, pipe and pistream
-  classes and tests found in the Boost.Process library.
-
-  Author: Julio Merino <[email protected]>
-
 * admin/check-style.sh, admin/check-style-common.awk,
   admin/check-style-cpp.awk, admin/check-style-shell.awk: These files,
   except the first one, were first implemented in the Buildtool project.
@@ -95,6 +92,15 @@ clarify this fact.
 
   Author: Julio Merino <[email protected]>
 
+* m4/ac_cxx_compile_stdcxx.m4: This file comes from the
+  [autoconf-archive][] project and is GPLv3 licensed, with exceptions as
+  noted in the project.
+
+  Please see the commit history for the file for authorship details.
+
+  Author: Enji Cooper <[email protected]>
+
+[autoconf-archive]: https://github.com/autoconf-archive/autoconf-archive
 
 ===========================================================================
-vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2
+vim: filetype=markdown:textwidth=75:expandtab:shiftwidth=2:softtabstop=2
diff --git a/contrib/atf/NEWS b/contrib/atf/NEWS
index ce15f5603c30..4549c1fcc4de 100644
--- a/contrib/atf/NEWS
+++ b/contrib/atf/NEWS
@@ -1,5 +1,38 @@
 # Major changes between releases
 
+## Changes in version 0.27.0
+
+Released on 2026/11/30.
+
+### Summary
+
+This is a minor bugfix release with the added feature for wchar_t equality
+testing with atf-c(3) (#218) and `atf-check` negate support (#240).  Both
+items were contributed by @dag-erling.
+
+### Bugfixes
+
+* #234: fix(build): only set _FORTIFY_SOURCE if ASAN is not enabled
+* #235: fix(build): fix out-of-tree builds
+* #238: atf-c++(3): document require_{kmod,prog} APIs
+
+### Developer Workflow Changes
+
+* #213: feat: Add CONTRIBUTING.md, et al
+* #236: chore: update checkout and upload-artifact actions
+* #237: feat(ci): Add gcc workflow using Ubuntu 24.04
+
+### Feature Enhancements
+
+* #218: atf-c: Add equality macros for wchar_t strings
+* #240: feat: Upstream shorthand atf-check negate feature
+
+### Miscellaneous
+
+* #239: Apply cleanup from upcoming feature_present(3) support
+
+**Full Changelog**: 
https://github.com/freebsd/atf/compare/atf-0.26.1...atf-0.27.0
+
 ## Changes in version 0.26.1
 
 Released on 2026/11/25.
diff --git a/contrib/atf/atf-c++/atf-c++.3 b/contrib/atf/atf-c++/atf-c++.3
index 2254d481efff..d559cecfc1e5 100644
--- a/contrib/atf/atf-c++/atf-c++.3
+++ b/contrib/atf/atf-c++/atf-c++.3
@@ -22,7 +22,7 @@
 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.Dd October 13, 2014
+.Dd November 29, 2026
 .Dt ATF-C++ 3
 .Os
 .Sh NAME
@@ -49,6 +49,8 @@
 .Nm ATF_TEST_CASE_USE ,
 .Nm ATF_TEST_CASE_WITH_CLEANUP ,
 .Nm ATF_TEST_CASE_WITHOUT_HEAD ,
+.Nm atf::tc::require_kmod ,
+.Nm atf::tc::require_prog ,
 .Nm atf::utils::cat_file ,
 .Nm atf::utils::compare_file ,
 .Nm atf::utils::copy_file ,
@@ -86,6 +88,14 @@
 .Fn ATF_TEST_CASE_WITH_CLEANUP "name"
 .Fn ATF_TEST_CASE_WITHOUT_HEAD "name"
 .Ft void
+.Fo atf::tc::require_kmod
+.Fa "const char *kmod"
+.Fc
+.Ft void
+.Fo atf::tc::require_prog
+.Fa "const char *prog"
+.Fc
+.Ft void
 .Fo atf::utils::cat_file
 .Fa "const std::string& path"
 .Fa "const std::string& prefix"
@@ -142,7 +152,7 @@
 .Fc
 .Sh DESCRIPTION
 ATF provides a C++ programming interface to implement test programs.
-C++-based test programs follow this template:
+C++-based test programs follow this general template:
 .Bd -literal -offset indent
 extern "C" {
 \&... C-specific includes go here ...
diff --git a/contrib/atf/atf-c/atf-c.3 b/contrib/atf/atf-c/atf-c.3
index f1ad9d2f4af1..2d282b5adb80 100644
--- a/contrib/atf/atf-c/atf-c.3
+++ b/contrib/atf/atf-c/atf-c.3
@@ -22,7 +22,7 @@
 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.Dd October 10, 2025
+.Dd November 16, 2026
 .Dt ATF-C 3
 .Os
 .Sh NAME
@@ -35,6 +35,8 @@
 .Nm ATF_CHECK_MATCH_MSG ,
 .Nm ATF_CHECK_STREQ ,
 .Nm ATF_CHECK_STREQ_MSG ,
+.Nm ATF_CHECK_WCSEQ ,
+.Nm ATF_CHECK_WCSEQ_MSG ,
 .Nm ATF_CHECK_INTEQ ,
 .Nm ATF_CHECK_INTEQ_MSG ,
 .Nm ATF_CHECK_ERRNO ,
@@ -46,6 +48,8 @@
 .Nm ATF_REQUIRE_MATCH_MSG ,
 .Nm ATF_REQUIRE_STREQ ,
 .Nm ATF_REQUIRE_STREQ_MSG ,
+.Nm ATF_REQUIRE_WCSEQ ,
+.Nm ATF_REQUIRE_WCSEQ_MSG ,
 .Nm ATF_REQUIRE_INTEQ ,
 .Nm ATF_REQUIRE_INTEQ_MSG ,
 .Nm ATF_REQUIRE_ERRNO ,
@@ -105,6 +109,8 @@
 .Fn ATF_CHECK_MATCH_MSG "regexp" "string" "fail_msg_fmt" ...
 .Fn ATF_CHECK_STREQ "expected_string" "actual_string"
 .Fn ATF_CHECK_STREQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ...
+.Fn ATF_CHECK_WCSEQ "expected_string" "actual_string"
+.Fn ATF_CHECK_WCSEQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ...
 .Fn ATF_CHECK_INTEQ "expected_int" "actual_int"
 .Fn ATF_CHECK_INTEQ_MSG "expected_int" "actual_int" "fail_msg_fmt" ...
 .Fn ATF_CHECK_ERRNO "expected_errno" "bool_expression"
@@ -116,6 +122,8 @@
 .Fn ATF_REQUIRE_MATCH_MSG "regexp" "string" "fail_msg_fmt" ...
 .Fn ATF_REQUIRE_STREQ "expected_string" "actual_string"
 .Fn ATF_REQUIRE_STREQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ...
+.Fn ATF_REQUIRE_WCSEQ "expected_string" "actual_string"
+.Fn ATF_REQUIRE_WCSEQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ...
 .Fn ATF_REQUIRE_INTEQ "expected_int" "actual_int"
 .Fn ATF_REQUIRE_INTEQ_MSG "expected_int" "actual_int" "fail_msg_fmt" ...
 .Fn ATF_REQUIRE_ERRNO "expected_errno" "bool_expression"
@@ -609,6 +617,16 @@ take two strings and fail if the two are not equal 
character by character.
 The common style is to put the expected string in the first parameter and the
 observed string in the second parameter.
 .Pp
+.Fn ATF_CHECK_WCSEQ ,
+.Fn ATF_CHECK_WCSEQ_MSG ,
+.Fn ATF_REQUIRE_WCSEQ
+and
+.Fn ATF_REQUIRE_WCSEQ_MSG
+take two wide character strings and fail if the two are not equal character by
+character.
+The common style is to put the expected string in the first parameter and the
+observed string in the second parameter.
+.Pp
 .Fn ATF_CHECK_INTEQ ,
 .Fn ATF_CHECK_INTEQ_MSG ,
 .Fn ATF_REQUIRE_INTEQ
diff --git a/contrib/atf/atf-c/macros.h b/contrib/atf/atf-c/macros.h
index 9da7a714703a..88c6e38d934b 100644
--- a/contrib/atf/atf-c/macros.h
+++ b/contrib/atf/atf-c/macros.h
@@ -198,6 +198,42 @@
                       _atf_expected, _atf_actual, ##__VA_ARGS__);      \
     } while (0)
 
+#define ATF_REQUIRE_WCSEQ(expected, actual)                        \
+    do {                                                           \
+        const wchar_t* _atf_expected = (expected);                 \
+        const wchar_t* _atf_actual = (actual);                     \
+        ATF_REQUIRE_MSG(wcscmp(_atf_expected, _atf_actual) == 0,   \
+                        "%s != %s (%S != %S)", #expected, #actual, \
+                        _atf_expected, _atf_actual);               \
+    } while (0)
+
+#define ATF_CHECK_WCSEQ(expected, actual)                        \
+    do {                                                         \
+        const wchar_t* _atf_expected = (expected);               \
+        const wchar_t* _atf_actual = (actual);                   \
+        ATF_CHECK_MSG(wcscmp(_atf_expected, _atf_actual) == 0,   \
+                      "%s != %s (%S != %S)", #expected, #actual, \
+                      _atf_expected, _atf_actual);               \
+    } while (0)
+
+#define ATF_REQUIRE_WCSEQ_MSG(expected, actual, fmt, ...)                \
+    do {                                                                 \
+        const wchar_t* _atf_expected = (expected);                       \
+        const wchar_t* _atf_actual = (actual);                           \
+        ATF_REQUIRE_MSG(wcscmp(_atf_expected, _atf_actual) == 0,         \
+                        "%s != %s (%S != %S): " fmt, #expected, #actual, \
+                        _atf_expected, _atf_actual, ##__VA_ARGS__);      \
+    } while (0)
+
+#define ATF_CHECK_WCSEQ_MSG(expected, actual, fmt, ...)                \
+    do {                                                               \
+        const wchar_t* _atf_expected = (expected);                     \
+        const wchar_t* _atf_actual = (actual);                         \
+        ATF_CHECK_MSG(wcscmp(_atf_expected, _atf_actual) == 0,         \
+                      "%s != %s (%S != %S): " fmt, #expected, #actual, \
+                      _atf_expected, _atf_actual, ##__VA_ARGS__);      \
+    } while (0)
+
 #define ATF_REQUIRE_INTEQ(expected, actual)                                    
\
     do {                                                                       
\
         intmax_t _atf_expected = (expected);                                   
\
diff --git a/contrib/atf/atf-c/macros_test.c b/contrib/atf/atf-c/macros_test.c
index c8fc038a4387..07750eb11f61 100644
--- a/contrib/atf/atf-c/macros_test.c
+++ b/contrib/atf/atf-c/macros_test.c
@@ -36,6 +36,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <wchar.h>
 
 #include "atf-c.h"
 #include "atf-c/detail/fs.h"
@@ -118,6 +119,11 @@ init_and_run_h_tc(const char* name, void 
(*head)(atf_tc_t*),
 #define H_CHECK_STREQ(id, v1, v2) \
     H_DEF(check_streq_##id, ATF_CHECK_STREQ(v1, v2))
 
+#define H_CHECK_WCSEQ_HEAD_NAME(id) ATF_TC_HEAD_NAME(h_check_wcseq_##id)
+#define H_CHECK_WCSEQ_BODY_NAME(id) ATF_TC_BODY_NAME(h_check_wcseq_##id)
+#define H_CHECK_WCSEQ(id, v1, v2) \
+    H_DEF(check_wcseq_##id, ATF_CHECK_WCSEQ(v1, v2))
+
 #define H_CHECK_MATCH_HEAD_NAME(id) ATF_TC_HEAD_NAME(h_check_match_##id)
 #define H_CHECK_MATCH_BODY_NAME(id) ATF_TC_BODY_NAME(h_check_match_##id)
 #define H_CHECK_MATCH(id, v1, v2) \
@@ -133,6 +139,11 @@ init_and_run_h_tc(const char* name, void 
(*head)(atf_tc_t*),
 #define H_CHECK_STREQ_MSG(id, v1, v2, msg) \
     H_DEF(check_streq_msg_##id, ATF_CHECK_STREQ_MSG(v1, v2, msg))
 
+#define H_CHECK_WCSEQ_MSG_HEAD_NAME(id) 
ATF_TC_HEAD_NAME(h_check_wcseq_msg_##id)
+#define H_CHECK_WCSEQ_MSG_BODY_NAME(id) 
ATF_TC_BODY_NAME(h_check_wcseq_msg_##id)
+#define H_CHECK_WCSEQ_MSG(id, v1, v2, msg) \
+    H_DEF(check_wcseq_msg_##id, ATF_CHECK_WCSEQ_MSG(v1, v2, msg))
+
 #define H_CHECK_MATCH_MSG_HEAD_NAME(id) 
ATF_TC_HEAD_NAME(h_check_match_msg_##id)
 #define H_CHECK_MATCH_MSG_BODY_NAME(id) 
ATF_TC_BODY_NAME(h_check_match_msg_##id)
 #define H_CHECK_MATCH_MSG(id, v1, v2, msg) \
@@ -162,6 +173,11 @@ init_and_run_h_tc(const char* name, void 
(*head)(atf_tc_t*),
 #define H_REQUIRE_STREQ(id, v1, v2) \
     H_DEF(require_streq_##id, ATF_REQUIRE_STREQ(v1, v2))
 
+#define H_REQUIRE_WCSEQ_HEAD_NAME(id) ATF_TC_HEAD_NAME(h_require_wcseq_##id)
+#define H_REQUIRE_WCSEQ_BODY_NAME(id) ATF_TC_BODY_NAME(h_require_wcseq_##id)
+#define H_REQUIRE_WCSEQ(id, v1, v2) \
+    H_DEF(require_wcseq_##id, ATF_REQUIRE_WCSEQ(v1, v2))
+
 #define H_REQUIRE_MATCH_HEAD_NAME(id) ATF_TC_HEAD_NAME(h_require_match_##id)
 #define H_REQUIRE_MATCH_BODY_NAME(id) ATF_TC_BODY_NAME(h_require_match_##id)
 #define H_REQUIRE_MATCH(id, v1, v2) \
@@ -179,6 +195,13 @@ init_and_run_h_tc(const char* name, void 
(*head)(atf_tc_t*),
 #define H_REQUIRE_STREQ_MSG(id, v1, v2, msg) \
     H_DEF(require_streq_msg_##id, ATF_REQUIRE_STREQ_MSG(v1, v2, msg))
 
+#define H_REQUIRE_WCSEQ_MSG_HEAD_NAME(id) \
+    ATF_TC_HEAD_NAME(h_require_wcseq_msg_##id)
+#define H_REQUIRE_WCSEQ_MSG_BODY_NAME(id) \
+    ATF_TC_BODY_NAME(h_require_wcseq_msg_##id)
+#define H_REQUIRE_WCSEQ_MSG(id, v1, v2, msg) \
+    H_DEF(require_wcseq_msg_##id, ATF_REQUIRE_WCSEQ_MSG(v1, v2, msg))
+
 #define H_REQUIRE_MATCH_MSG_HEAD_NAME(id) \
     ATF_TC_HEAD_NAME(h_require_match_msg_##id)
 #define H_REQUIRE_MATCH_MSG_BODY_NAME(id) \
@@ -369,8 +392,8 @@ ATF_TC_BODY(check, tc)
 struct check_eq_test {
     void (*head)(atf_tc_t*);
     void (*body)(const atf_tc_t*);
-    const char* v1;
-    const char* v2;
+    const void* v1;
+    const void* v2;
     const char* msg;
     bool ok;
 };
@@ -381,8 +404,36 @@ do_check_eq_tests(const struct check_eq_test* tests)
     const struct check_eq_test* t;
 
     for (t = &tests[0]; t->head != NULL; t++) {
-        printf("Checking with %s, %s and expecting %s\n", t->v1, t->v2,
-               t->ok ? "true" : "false");
+        printf("Checking with %s, %s and expecting %s\n", (const char*)t->v1,
+               (const char*)t->v2, t->ok ? "true" : "false");
+
+        init_and_run_h_tc("h_check", t->head, t->body);
+
+        ATF_CHECK(exists("before"));
+        ATF_CHECK(exists("after"));
+
+        if (t->ok) {
+            ATF_REQUIRE(atf_utils_grep_file("^passed", "result"));
+        } else {
+            ATF_REQUIRE(atf_utils_grep_file("^failed", "result"));
+            ATF_CHECK(atf_utils_grep_file("Check failed: .*"
+                                          "macros_test.c:[0-9]+: %s$",
+                                          "error", t->msg));
+        }
+
+        ATF_CHECK(unlink("before") != -1);
+        ATF_CHECK(unlink("after") != -1);
+    }
+}
+
+static void
+do_check_eq_tests_w(const struct check_eq_test* tests)
+{
+    const struct check_eq_test* t;
+
+    for (t = &tests[0]; t->head != NULL; t++) {
+        printf("Checking with %S, %S and expecting %s\n", (const 
wchar_t*)t->v1,
+               (const wchar_t*)t->v2, t->ok ? "true" : "false");
 
         init_and_run_h_tc("h_check", t->head, t->body);
 
@@ -493,6 +544,56 @@ ATF_TC_BODY(check_streq, tc)
     do_check_eq_tests(tests);
 }
 
+H_CHECK_WCSEQ(1_1, L"1", L"1");
+H_CHECK_WCSEQ(1_2, L"1", L"2");
+H_CHECK_WCSEQ(2_1, L"2", L"1");
+H_CHECK_WCSEQ(2_2, L"2", L"2");
+H_CHECK_WCSEQ_MSG(1_1, L"1", L"1", "1 does not match 1");
+H_CHECK_WCSEQ_MSG(1_2, L"1", L"2", "1 does not match 2");
+H_CHECK_WCSEQ_MSG(2_1, L"2", L"1", "2 does not match 1");
+H_CHECK_WCSEQ_MSG(2_2, L"2", L"2", "2 does not match 2");
+const wchar_t* check_wcseq_var1 = L"5";
+const wchar_t* check_wcseq_var2 = L"9";
+H_CHECK_WCSEQ(vars, check_wcseq_var1, check_wcseq_var2);
+
+ATF_TC(check_wcseq);
+ATF_TC_HEAD(check_wcseq, tc)
+{
+    atf_tc_set_md_var(tc, "descr",
+                      "Tests the ATF_CHECK_WCSEQ and "
+                      "ATF_CHECK_WCSEQ_MSG macros");
+}
+ATF_TC_BODY(check_wcseq, tc)
+{
+    struct check_eq_test tests[] = {
+        { H_CHECK_WCSEQ_HEAD_NAME(1_1), H_CHECK_WCSEQ_BODY_NAME(1_1), L"1",
+          L"1", "L\"1\" != L\"1\" \\(1 != 1\\)", true },
+        { H_CHECK_WCSEQ_HEAD_NAME(1_2), H_CHECK_WCSEQ_BODY_NAME(1_2), L"1",
+          L"2", "L\"1\" != L\"2\" \\(1 != 2\\)", false },
+        { H_CHECK_WCSEQ_HEAD_NAME(2_1), H_CHECK_WCSEQ_BODY_NAME(2_1), L"2",
+          L"1", "L\"2\" != L\"1\" \\(2 != 1\\)", false },
+        { H_CHECK_WCSEQ_HEAD_NAME(2_2), H_CHECK_WCSEQ_BODY_NAME(2_2), L"2",
+          L"2", "L\"2\" != L\"2\" \\(2 != 2\\)", true },
+        { H_CHECK_WCSEQ_MSG_HEAD_NAME(1_1), H_CHECK_WCSEQ_MSG_BODY_NAME(1_1),
+          L"1", L"1", "L\"1\" != L\"1\" \\(1 != 1\\): 1 does not match 1",
+          true },
+        { H_CHECK_WCSEQ_MSG_HEAD_NAME(1_2), H_CHECK_WCSEQ_MSG_BODY_NAME(1_2),
+          L"1", L"2", "L\"1\" != L\"2\" \\(1 != 2\\): 1 does not match 2",
+          false },
+        { H_CHECK_WCSEQ_MSG_HEAD_NAME(2_1), H_CHECK_WCSEQ_MSG_BODY_NAME(2_1),
+          L"2", L"1", "L\"2\" != L\"1\" \\(2 != 1\\): 2 does not match 1",
+          false },
+        { H_CHECK_WCSEQ_MSG_HEAD_NAME(2_2), H_CHECK_WCSEQ_MSG_BODY_NAME(2_2),
+          L"2", L"2", "L\"2\" != L\"2\" \\(2 != 2\\): 2 does not match 2",
+          true },
+        { H_CHECK_WCSEQ_HEAD_NAME(vars), H_CHECK_WCSEQ_BODY_NAME(vars),
+          check_wcseq_var1, check_wcseq_var2,
+          "check_wcseq_var1 != check_wcseq_var2 \\(5 != 9\\)", false },
+        { NULL, NULL, 0, 0, "", false }
+    };
+    do_check_eq_tests_w(tests);
+}
+
 /* ---------------------------------------------------------------------
  * Test cases for the ATF_CHECK_MATCH and ATF_CHECK_MATCH_MSG macros.
  * --------------------------------------------------------------------- */
@@ -591,8 +692,8 @@ ATF_TC_BODY(require, tc)
 struct require_eq_test {
     void (*head)(atf_tc_t*);
     void (*body)(const atf_tc_t*);
-    const char* v1;
-    const char* v2;
+    const void* v1;
+    const void* v2;
     const char* msg;
     bool ok;
 };
@@ -603,8 +704,36 @@ do_require_eq_tests(const struct require_eq_test* tests)
     const struct require_eq_test* t;
 
     for (t = &tests[0]; t->head != NULL; t++) {
-        printf("Checking with %s, %s and expecting %s\n", t->v1, t->v2,
-               t->ok ? "true" : "false");
+        printf("Checking with %s, %s and expecting %s\n", (const char*)t->v1,
+               (const char*)t->v2, t->ok ? "true" : "false");
+
+        init_and_run_h_tc("h_require", t->head, t->body);
+
+        ATF_REQUIRE(exists("before"));
+        if (t->ok) {
+            ATF_REQUIRE(atf_utils_grep_file("^passed", "result"));
+            ATF_REQUIRE(exists("after"));
+        } else {
+            ATF_REQUIRE(atf_utils_grep_file("^failed: .*macros_test.c"
+                                            ":[0-9]+: %s$",
+                                            "result", t->msg));
+            ATF_REQUIRE(!exists("after"));
+        }
+
+        ATF_REQUIRE(unlink("before") != -1);
+        if (t->ok)
+            ATF_REQUIRE(unlink("after") != -1);
+    }
+}
+
+static void
+do_require_eq_tests_w(const struct require_eq_test* tests)
+{
+    const struct require_eq_test* t;
+
+    for (t = &tests[0]; t->head != NULL; t++) {
+        printf("Checking with %S, %S and expecting %s\n", (const 
wchar_t*)t->v1,
+               (const wchar_t*)t->v2, t->ok ? "true" : "false");
 
         init_and_run_h_tc("h_require", t->head, t->body);
 
@@ -719,6 +848,56 @@ ATF_TC_BODY(require_streq, tc)
     do_require_eq_tests(tests);
 }
 
+H_REQUIRE_WCSEQ(1_1, L"1", L"1");
+H_REQUIRE_WCSEQ(1_2, L"1", L"2");
+H_REQUIRE_WCSEQ(2_1, L"2", L"1");
+H_REQUIRE_WCSEQ(2_2, L"2", L"2");
+H_REQUIRE_WCSEQ_MSG(1_1, L"1", L"1", "1 does not match 1");
+H_REQUIRE_WCSEQ_MSG(1_2, L"1", L"2", "1 does not match 2");
+H_REQUIRE_WCSEQ_MSG(2_1, L"2", L"1", "2 does not match 1");
+H_REQUIRE_WCSEQ_MSG(2_2, L"2", L"2", "2 does not match 2");
+const wchar_t* require_wcseq_var1 = L"5";
+const wchar_t* require_wcseq_var2 = L"9";
+H_REQUIRE_WCSEQ(vars, require_wcseq_var1, require_wcseq_var2);
+
+ATF_TC(require_wcseq);
+ATF_TC_HEAD(require_wcseq, tc)
+{
+    atf_tc_set_md_var(tc, "descr",
+                      "Tests the ATF_REQUIRE_WCSEQ and "
+                      "ATF_REQUIRE_WCSEQ_MSG macros");
+}
+ATF_TC_BODY(require_wcseq, tc)
+{
+    struct require_eq_test tests[] = {
+        { H_REQUIRE_WCSEQ_HEAD_NAME(1_1), H_REQUIRE_WCSEQ_BODY_NAME(1_1), L"1",
+          L"1", "L\"1\" != L\"1\" \\(1 != 1\\)", true },
+        { H_REQUIRE_WCSEQ_HEAD_NAME(1_2), H_REQUIRE_WCSEQ_BODY_NAME(1_2), L"1",
+          L"2", "L\"1\" != L\"2\" \\(1 != 2\\)", false },
+        { H_REQUIRE_WCSEQ_HEAD_NAME(2_1), H_REQUIRE_WCSEQ_BODY_NAME(2_1), L"2",
+          L"1", "L\"2\" != L\"1\" \\(2 != 1\\)", false },
+        { H_REQUIRE_WCSEQ_HEAD_NAME(2_2), H_REQUIRE_WCSEQ_BODY_NAME(2_2), L"2",
+          L"2", "L\"2\" != L\"2\" \\(2 != 2\\)", true },
+        { H_REQUIRE_WCSEQ_MSG_HEAD_NAME(1_1),
+          H_REQUIRE_WCSEQ_MSG_BODY_NAME(1_1), L"1", L"1",
+          "L\"1\" != L\"1\" \\(1 != 1\\): 1 does not match 1", true },
+        { H_REQUIRE_WCSEQ_MSG_HEAD_NAME(1_2),
+          H_REQUIRE_WCSEQ_MSG_BODY_NAME(1_2), L"1", L"2",
+          "L\"1\" != L\"2\" \\(1 != 2\\): 1 does not match 2", false },
+        { H_REQUIRE_WCSEQ_MSG_HEAD_NAME(2_1),
+          H_REQUIRE_WCSEQ_MSG_BODY_NAME(2_1), L"2", L"1",
+          "L\"2\" != L\"1\" \\(2 != 1\\): 2 does not match 1", false },
+        { H_REQUIRE_WCSEQ_MSG_HEAD_NAME(2_2),
+          H_REQUIRE_WCSEQ_MSG_BODY_NAME(2_2), L"2", L"2",
+          "L\"2\" != L\"2\" \\(2 != 2\\): 2 does not match 2", true },
+        { H_REQUIRE_WCSEQ_HEAD_NAME(vars), H_REQUIRE_WCSEQ_BODY_NAME(vars),
+          require_wcseq_var1, require_wcseq_var2,
+          "require_wcseq_var1 != require_wcseq_var2 \\(5 != 9\\)", false },
+        { NULL, NULL, 0, 0, "", false }
+    };
+    do_require_eq_tests_w(tests);
+}
+
 /* ---------------------------------------------------------------------
  * Test cases for the ATF_REQUIRE_MATCH and ATF_REQUIRE_MATCH_MSG macros.
  * --------------------------------------------------------------------- */
@@ -865,12 +1044,14 @@ ATF_TP_ADD_TCS(tp)
     ATF_TP_ADD_TC(tp, check);
     ATF_TP_ADD_TC(tp, check_eq);
     ATF_TP_ADD_TC(tp, check_streq);
+    ATF_TP_ADD_TC(tp, check_wcseq);
     ATF_TP_ADD_TC(tp, check_errno);
     ATF_TP_ADD_TC(tp, check_match);
 
     ATF_TP_ADD_TC(tp, require);
     ATF_TP_ADD_TC(tp, require_eq);
     ATF_TP_ADD_TC(tp, require_streq);
+    ATF_TP_ADD_TC(tp, require_wcseq);
     ATF_TP_ADD_TC(tp, require_errno);
     ATF_TP_ADD_TC(tp, require_match);
 
diff --git a/contrib/atf/atf-c/tc.c b/contrib/atf/atf-c/tc.c
index 949ae99f15b1..abf90f6f5ab2 100644
--- a/contrib/atf/atf-c/tc.c
+++ b/contrib/atf/atf-c/tc.c
@@ -484,6 +484,19 @@ errno_test(struct context* ctx, const char* file, const 
size_t line,
     }
 }
 
+#if !defined(__FreeBSD__)
+static atf_error_t
+api_not_implemented(struct context* ctx)
+{
+    atf_dynstr_t reason;
+
+    format_reason_fmt(&reason, NULL, 0,
+                      "This API is only available on FreeBSD");
+    fail_requirement(ctx, &reason);
+    return atf_no_error();
+}
+#endif
+
 #if defined(__FreeBSD__)
 atf_error_t
 check_kmod(struct context* ctx, const char* kmod)
@@ -523,12 +536,7 @@ done:
 atf_error_t
 check_kmod(struct context* ctx, const char* kmod ATF_DEFS_ATTRIBUTE_UNUSED)
 {
-    atf_dynstr_t reason;
-
-    format_reason_fmt(&reason, NULL, 0,
-                      "This API is only available on FreeBSD");
-    fail_requirement(ctx, &reason);
-    return atf_no_error();
+    return api_not_implemented(ctx);
 }
 #endif
 
diff --git a/contrib/atf/atf-sh/atf-check.1 b/contrib/atf/atf-sh/atf-check.1
index 22e235dc5a6e..40883941a09f 100644
--- a/contrib/atf/atf-sh/atf-check.1
+++ b/contrib/atf/atf-sh/atf-check.1
@@ -22,7 +22,7 @@
 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.Dd October 21, 2026
+.Dd November 30, 2026
 .Dt ATF-CHECK 1
 .Os
 .Sh NAME
diff --git a/contrib/atf/atf-sh/atf-check.cpp b/contrib/atf/atf-sh/atf-check.cpp
index d6c87cfa1f14..9cc873550d9b 100644
--- a/contrib/atf/atf-sh/atf-check.cpp
+++ b/contrib/atf/atf-sh/atf-check.cpp
@@ -914,7 +914,7 @@ atf_check::main(void)
 
     if (m_status_checks.empty()) {
         m_status_checks.push_back(status_check(sc_exit, negate, EXIT_SUCCESS,
-            false));
+                                               false));
     } else if (m_status_checks.size() > 1) {
         // TODO: Remove this restriction.
         throw atf::application::usage_error("Cannot specify -s more than 
once");
diff --git a/contrib/atf/atf-sh/atf_check_test.sh 
b/contrib/atf/atf-sh/atf_check_test.sh
index 3495473f83fd..a095358d8f55 100644
--- a/contrib/atf/atf-sh/atf_check_test.sh
+++ b/contrib/atf/atf-sh/atf_check_test.sh
@@ -210,12 +210,12 @@ flush_stdout_on_death_body()
 atf_test_case negate
 negate_body()
 {
-       atf_check true
-       atf_check ! false
-       atf_check ! ! true
-       atf_check ! ! ! false
-       atf_check true !
-       atf_check -o inline:'!\n' echo !
+    atf_check true
+    atf_check ! false
+    atf_check ! ! true
+    atf_check ! ! ! false
+    atf_check true !
+    atf_check -o inline:'!\n' echo !
 }
 
 atf_init_test_cases()
diff --git a/contrib/atf/atf-sh/libatf-sh.subr 
b/contrib/atf/atf-sh/libatf-sh.subr
index 35810a63bae3..f2dc05f1001c 100644
--- a/contrib/atf/atf-sh/libatf-sh.subr
+++ b/contrib/atf/atf-sh/libatf-sh.subr
@@ -845,6 +845,8 @@ atf_require_kmod_supported()
 atf_require_kmod()
 {
     kldstat -q -m "${1}" || \
-        atf_skip "The required kmod ${1} is not loaded"
+        atf_skip "The required kmod (${1}) is not loaded"
 }
 # END `FreeBSD.subr`.
+
+# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
diff --git a/contrib/atf/atf-sh/libatf-sh/FreeBSD.subr 
b/contrib/atf/atf-sh/libatf-sh/FreeBSD.subr
new file mode 100644
index 000000000000..8f8800a043f5
--- /dev/null
+++ b/contrib/atf/atf-sh/libatf-sh/FreeBSD.subr
@@ -0,0 +1,24 @@
+# BEGIN `FreeBSD.subr`.
+#
+# Copyright (c) 2026 Enji Cooper <[email protected]>.
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause
+
+atf_require_kmod_supported()
+{
+    true
+}
+
+# \brief FreeBSD specific helper routine for ensuring that a kmod has been
+# loaded.
+#
+# \param kmod a target kmod.
+atf_require_kmod()
+{
+    kldstat -q -m "${1}" || \
+        atf_skip "The required kmod (${1}) is not loaded"
+}
+# END `FreeBSD.subr`.
+
+# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
diff --git a/contrib/atf/atf-sh/libatf-sh/common.subr 
b/contrib/atf/atf-sh/libatf-sh/common.subr
new file mode 100644
index 000000000000..f9cbd0cd76bf
--- /dev/null
+++ b/contrib/atf/atf-sh/libatf-sh/common.subr
@@ -0,0 +1,816 @@
+# Copyright (c) 2007 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# ------------------------------------------------------------------------
+# GLOBAL VARIABLES
+# ------------------------------------------------------------------------
+
+# Values for the expect property.
+Expect=pass
+Expect_Reason=
+
+# A boolean variable that indicates whether we are parsing a test case's
+# head or not.
+Parsing_Head=false
+
+# The program name.
+Prog_Name=${0##*/}
+
+# The file to which the test case will print its result.
+Results_File=
+
+# The test program's source directory: i.e. where its auxiliary data files
+# and helper utilities can be found.  Can be overriden through the '-s' flag.
+Source_Dir="$(dirname ${0})"
+
+# Indicates the test case we are currently processing.
+Test_Case=
+
+# List of meta-data variables for the current test case.
+Test_Case_Vars=
+
+# The list of all test cases provided by the test program.
+Test_Cases=
+
+# ------------------------------------------------------------------------
+# PUBLIC INTERFACE
+# ------------------------------------------------------------------------
+
+#
+# atf_add_test_case tc-name
+#
+#   Adds the given test case to the list of test cases that form the test
+#   program.  The name provided here must be accompanied by two functions
+#   named after it: <tc-name>_head and <tc-name>_body, and optionally by
+#   a <tc-name>_cleanup function.
+#
+atf_add_test_case()
+{
+    Test_Cases="${Test_Cases} ${1}"
+}
+
+#
+# atf_check cmd expcode expout experr
+#
+#   Executes atf-check with given arguments and automatically calls
+#   atf_fail in case of failure.
+#
+atf_check()
+{
+    ${Atf_Check} "${@}" || \
+        atf_fail "atf-check failed; see the output of the test for details"
+}
+
+#
+# atf_check_equal expected_expression actual_expression
+#
+#   Checks that expected_expression's value matches actual_expression's
+#   and, if not, raises an error.  Ideally expected_expression and
+#   actual_expression should be provided quoted (not expanded) so that
+#   the error message is helpful; otherwise it will only show the values,
+#   not the expressions themselves.
+#
+atf_check_equal()
+{
+    eval _val1=\"${1}\"
+    eval _val2=\"${2}\"
+    test "${_val1}" = "${_val2}" || \
+        atf_fail "${1} != ${2} (${_val1} != ${_val2})"
+}
+
+#
+# atf_check_not_equal expected_expression actual_expression
+#
+#   Checks that expected_expression's value does not match actual_expression's
+#   and, if it does, raises an error.  Ideally expected_expression and
+#   actual_expression should be provided quoted (not expanded) so that
+#   the error message is helpful; otherwise it will only show the values,
+#   not the expressions themselves.
+#
+atf_check_not_equal()
+{
+    eval _val1=\"${1}\"
+    eval _val2=\"${2}\"
+    test "${_val1}" != "${_val2}" || \
+        atf_fail "${1} == ${2} (${_val1} == ${_val2})"
+}
+
+#
+# atf_config_get varname [defvalue]
+#
+#   Prints the value of a configuration variable.  If it is not
+#   defined, prints the given default value.
+#
+atf_config_get()
+{
+    _varname="__tc_config_var_$(_atf_normalize ${1})"
+    if [ ${#} -eq 1 ]; then
+        eval _value=\"\${${_varname}-__unset__}\"
+        [ "${_value}" = __unset__ ] && \
+            _atf_error 1 "Could not find configuration variable \`${1}'"
+        echo ${_value}
+    elif [ ${#} -eq 2 ]; then
+        eval echo \${${_varname}-${2}}
+    else
+        _atf_error 1 "Incorrect number of parameters for atf_config_get"
+    fi
+}
+
+#
+# atf_config_has varname
+#
+#   Returns a boolean indicating if the given configuration variable is
+#   defined or not.
+#
+atf_config_has()
+{
+    _varname="__tc_config_var_$(_atf_normalize ${1})"
+    eval _value=\"\${${_varname}-__unset__}\"
+    [ "${_value}" != __unset__ ]
+}
+
+#
+# atf_expect_death reason
+#
+#   Sets the expectations to 'death'.
+#
+atf_expect_death()
+{
+    _atf_validate_expect
+
+    Expect=death
+    _atf_create_resfile "expected_death: ${*}"
+}
+
+#
+# atf_expect_timeout reason
+#
+#   Sets the expectations to 'timeout'.
+#
+atf_expect_timeout()
+{
+    _atf_validate_expect
+
+    Expect=timeout
+    _atf_create_resfile "expected_timeout: ${*}"
+}
+
+#
+# atf_expect_exit exitcode reason
+#
+#   Sets the expectations to 'exit'.
+#
+atf_expect_exit()
+{
+    _exitcode="${1}"; shift
+
+    _atf_validate_expect
+
+    Expect=exit
+    if [ "${_exitcode}" = "-1" ]; then
+        _atf_create_resfile "expected_exit: ${*}"
+    else
+        _atf_create_resfile "expected_exit(${_exitcode}): ${*}"
+    fi
+}
+
+#
+# atf_expect_fail reason
+#
+#   Sets the expectations to 'fail'.
+#
+atf_expect_fail()
+{
+    _atf_validate_expect
+
+    Expect=fail
+    Expect_Reason="${*}"
+}
+
+#
+# atf_expect_skip reason
+#
+#   Sets the expectations to 'skip'.
+#
+atf_expect_skip()
+{
+    _atf_validate_expect
+
+    Expect=skip
+    Expect_Reason="${*}"
+}
+
+#
+# atf_expect_pass
+#
+#   Sets the expectations to 'pass'.
+#
+atf_expect_pass()
+{
+    _atf_validate_expect
*** 619 LINES SKIPPED ***

Reply via email to