]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Allow testsuite to run on Windows
authorRamiro Polla <ramiro.polla@gmail.com>
Thu, 15 Jul 2010 19:08:20 +0000 (16:08 -0300)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 16 Jul 2010 14:22:56 +0000 (16:22 +0200)
The equivalent to /dev/null on Windows is NUL. The basedir test suite doesn't
work since gcc on windows gives absolute paths for all files. The link test
suite doesn't work on MSYS since it does not support symlinks with ln -s.

test.sh

diff --git a/test.sh b/test.sh
index ace9efa80a664e82505fb3629982d6de96230198..016178da90f98b988015deb4e6edc1ede82b3272 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -601,12 +601,12 @@ EOF
     # Check that -Wp,-MD,file.d,-P disables direct mode.
     testname="-Wp,-MD,file.d,-P"
     $CCACHE -z >/dev/null
-    $CCACHE $COMPILER -c -Wp,-MD,/dev/null,-P test.c
+    $CCACHE $COMPILER -c -Wp,-MD,$DEVNULL,-P test.c
     checkstat 'cache hit (direct)' 0
     checkstat 'cache hit (preprocessed)' 0
     checkstat 'cache miss' 1
 
-    $CCACHE $COMPILER -c -Wp,-MD,/dev/null,-P test.c
+    $CCACHE $COMPILER -c -Wp,-MD,$DEVNULL,-P test.c
     checkstat 'cache hit (direct)' 0
     checkstat 'cache hit (preprocessed)' 1
     checkstat 'cache miss' 1
@@ -615,12 +615,12 @@ EOF
     # Check that -Wp,-MMD,file.d,-P disables direct mode.
     testname="-Wp,-MDD,file.d,-P"
     $CCACHE -z >/dev/null
-    $CCACHE $COMPILER -c -Wp,-MMD,/dev/null,-P test.c
+    $CCACHE $COMPILER -c -Wp,-MMD,$DEVNULL,-P test.c
     checkstat 'cache hit (direct)' 0
     checkstat 'cache hit (preprocessed)' 0
     checkstat 'cache miss' 1
 
-    $CCACHE $COMPILER -c -Wp,-MMD,/dev/null,-P test.c
+    $CCACHE $COMPILER -c -Wp,-MMD,$DEVNULL,-P test.c
     checkstat 'cache hit (direct)' 0
     checkstat 'cache hit (preprocessed)' 1
     checkstat 'cache miss' 1
@@ -1546,19 +1546,28 @@ export CCACHE_NODIRECT
 
 all_suites="
 base
-link
 hardlink
 cpp2
 nlevels4
 nlevels1
 direct
-basedir
 compression
 readonly
 extrafiles
 cleanup
 "
 
+host_os="`uname -s`"
+case $host_os in
+    *MINGW*|*mingw*)
+        DEVNULL=NUL
+        ;;
+    *)
+        DEVNULL=/dev/null
+        all_suites="$all_suites link basedir"
+        ;;
+esac
+
 if [ -z "$suites" ]; then
     suites="$all_suites"
 fi