This environment variable is supposedly set according to the contents
of ~/.CFUserTextEncoding, and certainly on MacOS 14 (Sonoma) it shows
up in the environment, causing commandtest to fail. However, the value
that is shown in $__CF_USER_TEXT_ENCODING during the test 1) is not in
the environment of the shell the test is run from, and 2) doesn't
match the contents of ~/.CFUserTextEncoding.

It is true, though, that filtering out this environment setting from
the test results permits commandtest to pass on MacOS 14.

Signed-off-by: Laine Stump <la...@redhat.com>
---

[*] There may be a better way to suppress this environment setting
    (maybe something done to prevent it from ever being added to the
    environment in the first place?), and that would be fine too. This
    patch does work though.

[*] Andrea's patches to force rpcgen to generate ANSI C code are also
    required for the test suite to pass on MacOS 14.

 tests/commandhelper.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 9b56feb120..08ee48a3a8 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -169,9 +169,12 @@ static int printEnvironment(FILE *log)
 
     for (i = 0; i < length; i++) {
         /* Ignore the variables used to instruct the loader into
-         * behaving differently, as they could throw the tests off. */
-        if (!STRPREFIX(newenv[i], "LD_"))
+         * behaving differently, as they could throw the tests off.
+         * Also ignore __CF_USER_TEXT_ENCODING, which is set by MacOS. */
+        if (!STRPREFIX(newenv[i], "LD_") &&
+            !STRPREFIX(newenv[i], "__CF_USER_TEXT_ENCODING=")) {
             fprintf(log, "ENV:%s\n", newenv[i]);
+        }
     }
 
     return 0;
-- 
2.41.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-le...@lists.libvirt.org

Reply via email to