diff options
author | Thomas Otto <thomas.otto@psd-fs.de> | 2018-06-06 12:52:36 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2018-09-02 14:06:38 +0200 |
commit | 181298b9eb32c4e31d207c7bedeaa58c29bbfe4a (patch) | |
tree | 90a77dffe35c122ad223a00275b28fbd799dac73 | |
parent | 1861bb0261762a6e96d4bb47429a348e024512d6 (diff) | |
download | ccache-181298b9eb32c4e31d207c7bedeaa58c29bbfe4a.tar.gz |
test: Fix various Solaris shell issues
-rwxr-xr-x | test/run | 2 | ||||
-rw-r--r-- | test/suites/base.bash | 21 | ||||
-rw-r--r-- | test/suites/cpp1.bash | 2 | ||||
-rw-r--r-- | test/suites/direct.bash | 2 |
4 files changed, 17 insertions, 10 deletions
@@ -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 diff --git a/test/suites/base.bash b/test/suites/base.bash index f2c6cb8d..cbfee846 100644 --- a/test/suites/base.bash +++ b/test/suites/base.bash @@ -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 diff --git a/test/suites/cpp1.bash b/test/suites/cpp1.bash index 965d4667..6655778d 100644 --- a/test/suites/cpp1.bash +++ b/test/suites/cpp1.bash @@ -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" diff --git a/test/suites/direct.bash b/test/suites/direct.bash index 085029c0..f12d6c48 100644 --- a/test/suites/direct.bash +++ b/test/suites/direct.bash @@ -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 |