aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mehrdad Afshari <mehrdada@users.noreply.github.com>2017-12-19 14:52:50 -0800
committerGravatar GitHub <noreply@github.com>2017-12-19 14:52:50 -0800
commit0dd982cf4c409d072f2b1c537d65f93001cc0f77 (patch)
tree6ae569050fbc923d555aa1bac9dc817d04133450
parente9b0fd07a579b1c10e6acacb4d6a59b1ac6a12d6 (diff)
parent5de0a1f44b4f20cf180bb3b6f7600e3cd962295d (diff)
Merge pull request #13823 from mehrdada/shellcheckify-runtests-slash-sanity
shellcheckify `tools/run_tests/sanity`
-rwxr-xr-xtools/run_tests/sanity/check_clang_tidy.sh6
-rwxr-xr-xtools/run_tests/sanity/check_owners.sh10
-rwxr-xr-xtools/run_tests/sanity/check_shellcheck.sh1
-rwxr-xr-xtools/run_tests/sanity/check_submodules.sh14
-rwxr-xr-xtools/run_tests/sanity/check_unsecure.sh8
-rwxr-xr-xtools/run_tests/sanity/core_untyped_structs.sh2
6 files changed, 21 insertions, 20 deletions
diff --git a/tools/run_tests/sanity/check_clang_tidy.sh b/tools/run_tests/sanity/check_clang_tidy.sh
index 42ab511a20..6c4caa1ee6 100755
--- a/tools/run_tests/sanity/check_clang_tidy.sh
+++ b/tools/run_tests/sanity/check_clang_tidy.sh
@@ -16,6 +16,6 @@
set -e
make buildtests \
- -j `python -c 'import multiprocessing; print multiprocessing.cpu_count()'`
-find src/core src/cpp test/core test/cpp -name '*.h' -or -name '*.cc' | \
- xargs tools/distrib/run_clang_tidy.py $*
+ -j "$(python -c 'import multiprocessing; print multiprocessing.cpu_count()')"
+find src/core src/cpp test/core test/cpp -print0 -name '*.h' -or -name '*.cc' \
+ | xargs -0 tools/distrib/run_clang_tidy.py "$@"
diff --git a/tools/run_tests/sanity/check_owners.sh b/tools/run_tests/sanity/check_owners.sh
index b681fed1bb..de0e092578 100755
--- a/tools/run_tests/sanity/check_owners.sh
+++ b/tools/run_tests/sanity/check_owners.sh
@@ -18,12 +18,12 @@ set -e
export TEST=true
-cd `dirname $0`/../../..
+cd "$(dirname "$0")/../../.."
owners=.github/CODEOWNERS
-want_owners=`mktemp /tmp/submXXXXXX`
+want_owners=$(mktemp /tmp/submXXXXXX)
-tools/mkowners/mkowners.py -o $want_owners
-diff -u $owners $want_owners
+tools/mkowners/mkowners.py -o "$want_owners"
+diff -u "$owners" "$want_owners"
-rm $want_owners
+rm "$want_owners"
diff --git a/tools/run_tests/sanity/check_shellcheck.sh b/tools/run_tests/sanity/check_shellcheck.sh
index f9b09167db..f2cba1892b 100755
--- a/tools/run_tests/sanity/check_shellcheck.sh
+++ b/tools/run_tests/sanity/check_shellcheck.sh
@@ -20,6 +20,7 @@ ROOT="$(dirname "$0")/../../.."
DIRS=(
'tools/run_tests/helper_scripts'
+ 'tools/run_tests/sanity'
)
for dir in "${DIRS[@]}"; do
diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh
index b573d21f4f..ca604c6e52 100755
--- a/tools/run_tests/sanity/check_submodules.sh
+++ b/tools/run_tests/sanity/check_submodules.sh
@@ -19,13 +19,13 @@ set -e
export TEST=true
-cd `dirname $0`/../../..
+cd "$(dirname "$0")/../../.."
-submodules=`mktemp /tmp/submXXXXXX`
-want_submodules=`mktemp /tmp/submXXXXXX`
+submodules=$(mktemp /tmp/submXXXXXX)
+want_submodules=$(mktemp /tmp/submXXXXXX)
-git submodule | awk '{ print $1 }' | sort > $submodules
-cat << EOF | awk '{ print $1 }' | sort > $want_submodules
+git submodule | awk '{ print $1 }' | sort > "$submodules"
+cat << EOF | awk '{ print $1 }' | sort > "$want_submodules"
5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8 third_party/benchmark (v1.2.0)
be2ee342d3781ddb954f91f8a7e660c6f59e87e5 third_party/boringssl (heads/chromium-stable)
886e7d75368e3f4fab3f4d0d3584e4abfc557755 third_party/boringssl-with-bazel (version_for_cocoapods_7.0-857-g886e7d7)
@@ -38,6 +38,6 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules
cc4bed2d74f7c8717e31f9579214ab52a9c9c610 third_party/abseil-cpp
EOF
-diff -u $submodules $want_submodules
+diff -u "$submodules" "$want_submodules"
-rm $submodules $want_submodules
+rm "$submodules" "$want_submodules"
diff --git a/tools/run_tests/sanity/check_unsecure.sh b/tools/run_tests/sanity/check_unsecure.sh
index 8584cbe36b..cca1235479 100755
--- a/tools/run_tests/sanity/check_unsecure.sh
+++ b/tools/run_tests/sanity/check_unsecure.sh
@@ -18,10 +18,10 @@ set -e
# Make sure that there is no path from known unsecure libraries and targets
# to an SSL library. Any failure among these will make the script fail.
-test `bazel query 'somepath("//:grpc_unsecure", "//external:libssl")' 2>/dev/null | wc -l` -eq 0 || exit 1
-test `bazel query 'somepath("//:grpc++_unsecure", "//external:libssl")' 2>/dev/null | wc -l` -eq 0 || exit 1
-test `bazel query 'somepath("//:grpc++_codegen_proto", "//external:libssl")' 2>/dev/null | wc -l` -eq 0 || exit 1
-test `bazel query 'somepath("//test/cpp/microbenchmarks:helpers", "//external:libssl")' 2>/dev/null | wc -l` -eq 0 || exit 1
+test "$(bazel query 'somepath("//:grpc_unsecure", "//external:libssl")' 2>/dev/null | wc -l)" -eq 0 || exit 1
+test "$(bazel query 'somepath("//:grpc++_unsecure", "//external:libssl")' 2>/dev/null | wc -l)" -eq 0 || exit 1
+test "$(bazel query 'somepath("//:grpc++_codegen_proto", "//external:libssl")' 2>/dev/null | wc -l)" -eq 0 || exit 1
+test "$(bazel query 'somepath("//test/cpp/microbenchmarks:helpers", "//external:libssl")' 2>/dev/null | wc -l)" -eq 0 || exit 1
exit 0
diff --git a/tools/run_tests/sanity/core_untyped_structs.sh b/tools/run_tests/sanity/core_untyped_structs.sh
index 792dd68fdd..af319096fd 100755
--- a/tools/run_tests/sanity/core_untyped_structs.sh
+++ b/tools/run_tests/sanity/core_untyped_structs.sh
@@ -15,7 +15,7 @@
set -e
-cd `dirname $0`/../../..
+cd "$(dirname "$0")/../../.."
#
# Make sure that all core struct/unions have a name or are typedef'ed