echo "Error: $file not formatted with Clang-Format"
echo 'Run "make format" or apply this diff:'
git diff $cf_color --no-index "$file" "$tmp_file" \
- | sed -r -e "s!^---.*!--- a/$file!" \
+ | sed -E -e "s!^---.*!--- a/$file!" \
-e "s!^\+\+\+.*!+++ b/$file!" \
-e "/diff --/d" -e "/index /d" \
-e "s/.[0-9]*.clang-format.tmp//"
echo "Error: xcrun --show-sdk-path failure"
exit 1
fi
+ export SDKROOT
SYSROOT="-isysroot `echo \"$SDKROOT\" | sed 's/ /\\ /g'`"
else
# ---------------------------------------
-all_suites="$(sed -rn 's/^addtest\((.*)\)$/\1/p' $(dirname $0)/CMakeLists.txt)"
+all_suites="$(sed -En 's/^addtest\((.*)\)$/\1/p' $(dirname $0)/CMakeLists.txt)"
for suite in $all_suites; do
. $(dirname $0)/suites/$suite.bash
chmod +x gcc
CCACHE_DEBUG=1 $CCACHE ./gcc -c test1.c
- compiler_type=$(sed -rn 's/.*Compiler type: (.*)/\1/p' test1.o.ccache-log)
+ compiler_type=$(sed -En 's/.*Compiler type: (.*)/\1/p' test1.o.ccache-log)
if [ "$compiler_type" != gcc ]; then
test_failed "Compiler type $compiler_type != gcc"
fi
rm test1.o.ccache-log
CCACHE_COMPILERTYPE=clang CCACHE_DEBUG=1 $CCACHE ./gcc -c test1.c
- compiler_type=$(sed -rn 's/.*Compiler type: (.*)/\1/p' test1.o.ccache-log)
+ compiler_type=$(sed -En 's/.*Compiler type: (.*)/\1/p' test1.o.ccache-log)
if [ "$compiler_type" != clang ]; then
test_failed "Compiler type $compiler_type != clang"
fi
local expected_level="$2"
slashes=$(find $CCACHE_DIR -name "*$type" \
- | sed -r -e 's!.*\.ccache/!!' -e 's![^/]*$!!' -e 's![^/]!!g')
+ | sed -E -e 's!.*\.ccache/!!' -e 's![^/]*$!!' -e 's![^/]!!g')
actual_level=$(echo -n "$slashes" | wc -c)
if [ "$actual_level" -ne "$expected_level" ]; then
test_failed "$type file on level $actual_level, expected level $expected_level"