]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don’t depend on which(1) to detect commands
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 5 Aug 2020 18:26:53 +0000 (20:26 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 6 Aug 2020 14:23:15 +0000 (16:23 +0200)
test/run
test/suites/profiling.bash
test/suites/profiling_clang.bash

index ca8e3097c0340f71176c8510fcd02c0fbe433781..c0214659ae5c07f2b4ed32cc986f61bb9c3dea97 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -195,7 +195,7 @@ expect_different_files() {
 
 is_equal_object_files() {
     if $HOST_OS_LINUX && $COMPILER_TYPE_CLANG; then
-        if ! which eu-elfcmp >/dev/null 2>&1; then
+        if ! command -v eu-elfcmp >/dev/null; then
             test_failed "Please install elfutils to get eu-elfcmp"
         fi
         eu-elfcmp -q "$1" "$2"
index 553f908658506f9846373698dc04390a7b08778b..e1ea00cd11f569b3ee7a7d8a32210b6fd1413123 100644 (file)
@@ -3,7 +3,7 @@ SUITE_profiling_PROBE() {
     if ! $COMPILER -fprofile-generate -c test.c 2>/dev/null; then
         echo "compiler does not support profiling"
     fi
-    if $COMPILER_TYPE_CLANG && ! which llvm-profdata$CLANG_VERSION_SUFFIX >/dev/null 2>/dev/null; then
+    if $COMPILER_TYPE_CLANG && ! command -v llvm-profdata$CLANG_VERSION_SUFFIX >/dev/null; then
         echo "llvm-profdata$CLANG_VERSION_SUFFIX tool not found"
     fi
 }
index 039a5d943b0163c20cbe95b9352a30bf1aa08092..332fbc7db909220b62681794d06aae825d7b7029 100644 (file)
@@ -1,7 +1,7 @@
 SUITE_profiling_clang_PROBE() {
     if ! $COMPILER_TYPE_CLANG; then
         echo "compiler is not Clang"
-    elif ! which llvm-profdata$CLANG_VERSION_SUFFIX >/dev/null 2>/dev/null; then
+    elif ! command -v llvm-profdata$CLANG_VERSION_SUFFIX >/dev/null; then
         echo "llvm-profdata$CLANG_VERSION_SUFFIX tool not found"
     fi
 }