]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Move basedir tests to the basedir test suite
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 17 Feb 2020 19:46:05 +0000 (20:46 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 23 Feb 2020 08:27:23 +0000 (09:27 +0100)
test/suites/base.bash
test/suites/basedir.bash

index 6e0c1a9282aadb70ca879a5a54fe14aa9ccc55f8..e625b34dfe0d292fc22988f8f090fa9e09cd5002 100644 (file)
@@ -1076,52 +1076,6 @@ EOF
     expect_stat 'cache hit (preprocessed)' 1
     expect_stat 'cache miss' 1
 
-    # -------------------------------------------------------------------------
-if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
-    TEST "Symlink to source directory"
-
-    mkdir dir
-    cd dir
-    mkdir -p d1/d2
-    echo '#define A "OK"' >d1/h.h
-    cat <<EOF >d1/d2/c.c
-#include <stdio.h>
-#include "../h.h"
-int main() { printf("%s\n", A); }
-EOF
-    echo '#define A "BUG"' >h.h
-    ln -s d1/d2 d3
-
-    CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/d3/c.c
-    $REAL_COMPILER c.o -o c
-    if [ "$(./c)" != OK ]; then
-        test_failed "Incorrect header file used"
-    fi
-
-fi
-    # -------------------------------------------------------------------------
-if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
-    TEST "Symlink to source file"
-
-    mkdir dir
-    cd dir
-    mkdir d
-    echo '#define A "BUG"' >d/h.h
-    cat <<EOF >d/c.c
-#include <stdio.h>
-#include "h.h"
-int main() { printf("%s\n", A); }
-EOF
-    echo '#define A "OK"' >h.h
-    ln -s d/c.c c.c
-
-    CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/c.c
-    $REAL_COMPILER c.o -o c
-    if [ "$(./c)" != OK ]; then
-        test_failed "Incorrect header file used"
-    fi
-
-fi
     # -------------------------------------------------------------------------
 if ! $HOST_OS_WINDOWS; then
     TEST ".incbin"
index ba623a8fc9294eaeef097a5c6c2af83eb4f9bb86..decfa893c0ea7fab61984344e31b30dfa18be3be 100644 (file)
@@ -45,7 +45,7 @@ SUITE_basedir() {
     expect_stat 'cache miss' 2
 
     # -------------------------------------------------------------------------
- if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
+if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
     TEST "Path normalization"
 
     cd dir1
@@ -64,8 +64,54 @@ SUITE_basedir() {
     expect_stat 'cache hit (direct)' 1
     expect_stat 'cache hit (preprocessed)' 0
     expect_stat 'cache miss' 1
+fi
+
+    # -------------------------------------------------------------------------
+if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
+    TEST "Symlink to source directory"
+
+    mkdir dir
+    cd dir
+    mkdir -p d1/d2
+    echo '#define A "OK"' >d1/h.h
+    cat <<EOF >d1/d2/c.c
+#include <stdio.h>
+#include "../h.h"
+int main() { printf("%s\n", A); }
+EOF
+    echo '#define A "BUG"' >h.h
+    ln -s d1/d2 d3
+
+    CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/d3/c.c
+    $REAL_COMPILER c.o -o c
+    if [ "$(./c)" != OK ]; then
+        test_failed "Incorrect header file used"
+    fi
+fi
+
+    # -------------------------------------------------------------------------
+if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
+    TEST "Symlink to source file"
+
+    mkdir dir
+    cd dir
+    mkdir d
+    echo '#define A "BUG"' >d/h.h
+    cat <<EOF >d/c.c
+#include <stdio.h>
+#include "h.h"
+int main() { printf("%s\n", A); }
+EOF
+    echo '#define A "OK"' >h.h
+    ln -s d/c.c c.c
+
+    CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/c.c
+    $REAL_COMPILER c.o -o c
+    if [ "$(./c)" != OK ]; then
+        test_failed "Incorrect header file used"
+    fi
+fi
 
- fi
     # -------------------------------------------------------------------------
     TEST "Rewriting in stderr"