]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: Fix printing of error messages with embedded newlines
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 20 Jul 2022 20:53:25 +0000 (22:53 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 20 Aug 2022 12:08:02 +0000 (14:08 +0200)
(cherry picked from commit 4b15d706691c2bef424888753dc98e4f5e1a3af3)

test/run

index 72235791f973e79d55e38294aa1cf7807295b086..1e381b35a10b0ad7df35480153cd7d912cd70b76 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -33,19 +33,19 @@ if [[ -t 1 ]]; then
 fi
 
 green() {
-    printf "$ansi_boldgreen%s$ansi_reset\n" "$*"
+    echo -e "$ansi_boldgreen$*$ansi_reset"
 }
 
 red() {
-    printf "$ansi_boldred%s$ansi_reset\n" "$*"
+    echo -e "$ansi_boldred$*$ansi_reset"
 }
 
 yellow() {
-    printf "$ansi_boldyellow%s$ansi_reset\n" "$*"
+    echo -e "$ansi_boldyellow$*$ansi_reset"
 }
 
 bold() {
-    printf "$ansi_bold%s$ansi_reset\n" "$*"
+    echo -e "$ansi_bold$*$ansi_reset"
 }
 
 test_failed_internal() {