SC2006: Use $(..) instead of legacy `..`.
SC2046: Quote this to prevent word splitting.
SC2086: Double quote to prevent globbing and word splitting.
-SC2094: Make sure not to read and write the same file in the same pipeline.
SC2103: Consider using ( subshell ), 'cd foo||exit', or pushd/popd instead.
-SC2155: Declare and assign separately to avoid masking return values.
SC2129: Consider using { cmd1; cmd2; } >> file instead of individual redirects.
# -------------------------------------------------------------------------
TEST "CCACHE_EXTRAFILES"
- echo a >a
- echo b >b
+ echo "a" >a
+ echo "b" >b
$CCACHE_COMPILE -c test1.c
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'files in cache' 1
expect_equal_object_files reference_test1.o test1.o
- local obj_in_cache=$(find $CCACHE_DIR -name '*.o')
+ local obj_in_cache
+ obj_in_cache=$(find $CCACHE_DIR -name '*.o')
if [ ! $obj_in_cache -ef test1.o ]; then
test_failed "Object file not hard-linked to cached object file"
fi
SUITE_masquerading_PROBE() {
- local compiler_binary=$(echo $COMPILER | cut -d' ' -f1)
+ local compiler_binary
+ compiler_binary=$(echo $COMPILER | cut -d' ' -f1)
if [ "$(dirname $compiler_binary)" != . ]; then
echo "compiler ($compiler_binary) not taken from PATH"
fi
}
SUITE_masquerading_SETUP() {
- local compiler_binary=$(echo $COMPILER | cut -d' ' -f1)
- local compiler_args=$(echo $COMPILER | cut -s -d' ' -f2-)
+ local compiler_binary
+ compiler_binary=$(echo $COMPILER | cut -d' ' -f1)
+ local compiler_args
+ compiler_args=$(echo $COMPILER | cut -s -d' ' -f2-)
ln -s "$CCACHE" $compiler_binary
CCACHE_COMPILE="./$compiler_binary $compiler_args"