]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: Avoid test failure in OpenBSD
authorIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Fri, 25 Oct 2024 16:06:44 +0000 (19:06 +0300)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Fri, 25 Oct 2024 16:06:44 +0000 (19:06 +0300)
The following errors can be seen for the 'execute mode' test in OpenBSD:
  build/libtool: test: <: missing second argument
  build/libtool: test: >: missing second argument

The cwrapper in OpenBSD cannot parse these symbols as arguments in
execute mode if there are no other characters with them.

* tests/execute-mode.at: Escape '<' and '>' in OpenBSD.

tests/execute-mode.at

index ac77c40bc719b87367e3592b97c50e53be3bb26a..44b723bc5ce1a52f64340387735eef9b8690f763 100644 (file)
@@ -170,6 +170,13 @@ LT_AT_NOINST_EXEC_CHECK([./main], [], [], [stdout], [ignore],
                        ["arg  with special chars: \$!&*'\`()"])
 AT_CHECK([$FGREP 'arg  with special chars: $!&*'\''`()' stdout], [], [ignore])
 
+# OpenBSD cwrapper has issues parsing '<' and '>' in execute mode without other
+# characters, so the symbols are escaped during testing in OpenBSD.
+escape=
+case $host_os in openbsd*)
+  escape='\' ;;
+esac
+
 # We always pair two args.  The first one is never the empty string.
 arg1=
 for arg2 in \
@@ -182,7 +189,7 @@ for arg2 in \
    'd\\' '' \
    'd\\\' '' \
    'd\\\\' '' \
-   '<' '>' \
+   "$escape<" "$escape>" \
    '<def>' ''
 do
   if test -z "$arg1"; then