]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: Fix various Solaris shell issues
authorThomas Otto <thomas.otto@psd-fs.de>
Wed, 6 Jun 2018 10:52:36 +0000 (12:52 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 2 Sep 2018 12:06:38 +0000 (14:06 +0200)
test/run
test/suites/base.bash
test/suites/cpp1.bash
test/suites/direct.bash

index 4e1efd4bbcaf188ae89f8f36953681ef54e4fb93..0aac132a792a3f5476ba014ab0d8f729a3e0f897 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -272,7 +272,7 @@ fi
 HOST_CCACHE_DIRS="/usr/lib/ccache/bin
 /usr/lib/ccache"
 for HOST_CCACHE_DIR in $HOST_CCACHE_DIRS; do
-    PATH=$(echo -n $PATH | awk -v RS=: -v ORS=: '$0 != "'$HOST_CCACHE_DIR'"' | sed 's/:$//')
+    PATH="$(echo "$PATH:" | awk -v RS=: -v ORS=: '$0 != "'$HOST_CCACHE_DIR'"' | sed 's/:*$//')"
 done
 export PATH
 
index f2c6cb8d1a0c426a3420675281928295c1763c05..cbfee8465776ff9ef3d295563e247a5657703b8d 100644 (file)
@@ -495,7 +495,8 @@ EOF
 
     cat >compiler.sh <<EOF
 #!/bin/sh
-export CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+export CCACHE_DISABLE
 exec $COMPILER "\$@"
 # A comment
 EOF
@@ -523,7 +524,8 @@ EOF
 
     cat >compiler.sh <<EOF
 #!/bin/sh
-export CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+export CCACHE_DISABLE
 exec $COMPILER "\$@"
 EOF
     chmod +x compiler.sh
@@ -546,7 +548,8 @@ EOF
 
     cat >compiler.sh <<EOF
 #!/bin/sh
-export CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+export CCACHE_DISABLE
 exec $COMPILER "\$@"
 EOF
     chmod +x compiler.sh
@@ -569,7 +572,8 @@ EOF
 
     cat >compiler.sh <<EOF
 #!/bin/sh
-export CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+export CCACHE_DISABLE
 exec $COMPILER "\$@"
 EOF
     chmod +x compiler.sh
@@ -595,7 +599,8 @@ EOF
 
     cat >compiler.sh <<EOF
 #!/bin/sh
-export CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+export CCACHE_DISABLE
 exec $COMPILER "\$@"
 EOF
     chmod +x compiler.sh
@@ -628,7 +633,8 @@ EOF
 
     cat >compiler.sh <<EOF
 #!/bin/sh
-export CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+export CCACHE_DISABLE
 exec $COMPILER "\$@"
 EOF
     chmod +x compiler.sh
@@ -787,7 +793,8 @@ EOF
 
     cat >buggy-cpp <<EOF
 #!/bin/sh
-export CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+export CCACHE_DISABLE
 if echo "\$*" | grep -- -D >/dev/null; then
   $COMPILER "\$@"
 else
index 965d46678425d2c16480cd3aa785dc7ccb9754f2..6655778dfe3aa6e093e856a94f7696632fae7e3d 100644 (file)
@@ -33,7 +33,7 @@ SUITE_cpp1() {
     elif $COMPILER_TYPE_CLANG; then
         cpp_flag="-frewrite-includes"
     fi
-    cpp_flag+=" -DBAZ=3"
+    cpp_flag="$cpp_flag -DBAZ=3"
 
     # -------------------------------------------------------------------------
     TEST "Base case"
index 085029c090c73c050727421dadb344c071b8aa51..f12d6c481fd3bc04f759755442bf2b322e340608 100644 (file)
@@ -448,7 +448,7 @@ EOF
     expect_stat 'cache miss' 1
     expect_equal_files test.d expected.d
 
-    find $CCACHE_DIR -name '*.d' -delete
+    find $CCACHE_DIR -name '*.d' -exec rm '{}' +
 
     # Missing file -> consider the cached result broken.
     $CCACHE_COMPILE -c -MD test.c