]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix test suite problems on OS X
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 5 Oct 2019 18:21:08 +0000 (20:21 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 5 Oct 2019 19:48:01 +0000 (21:48 +0200)
As suggested in PR #469.

Co-authored-by: Enrico Sorichetti <enricosorichetti@mac.com>
test/run
test/suites/debug_prefix_map.bash

index aa47df83548c269f11d02457f2c205520e0980e1..ed9f609db53751db194529c3d0c2b1295724d404 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -114,7 +114,7 @@ file_size() {
 
 objdump_cmd() {
     if $HOST_OS_APPLE; then
-        xcrun dwarfdump -r0 $1
+        xcrun dwarfdump -r 0 $1
     elif $HOST_OS_FREEBSD; then
         objdump -W $1
     elif $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then
@@ -378,23 +378,10 @@ else
 fi
 
 if $HOST_OS_APPLE; then
-    # Grab the developer directory from the environment or try xcode-select
-    if [ "$XCODE_DEVELOPER_DIR" = "" ]; then
-      XCODE_DEVELOPER_DIR=`xcode-select --print-path`
-      if [ "$XCODE_DEVELOPER_DIR" = "" ]; then
-        echo "Error: XCODE_DEVELOPER_DIR environment variable not set and xcode-select path not set"
-        exit 1
-      fi
-    fi
-
-    # Choose the latest SDK if an SDK root is not set
-    MAC_PLATFORM_DIR=$XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform
+    SDKROOT=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)
     if [ "$SDKROOT" = "" ]; then
-        SDKROOT="`eval ls -f -1 -d \"$MAC_PLATFORM_DIR/Developer/SDKs/\"*.sdk | tail -1`"
-        if [ "$SDKROOT" = "" ]; then
-            echo "Error: Cannot find a valid SDK root directory"
-            exit 1
-        fi
+        echo "Error: xcrun --show-sdk-path failure"
+        exit 1
     fi
 
     SYSROOT="-isysroot `echo \"$SDKROOT\" | sed 's/ /\\ /g'`"
index 553d7ffe5c4951cb19ae95629ac05cb2d09ecfeb..688daded4874626544ab48eb75506929f29f3352 100644 (file)
@@ -22,7 +22,7 @@ EOF
 
 grep_cmd() {
     if $HOST_OS_APPLE; then
-        grep "( \"$1\" )"
+        grep \"$1\"
     elif $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then
         test -n "$2" && grep -E "$1|$2" || grep "$1" # accept a relative path for source code, in addition to relocation dir
     else