From: Ramiro Polla Date: Thu, 15 Jul 2010 19:08:20 +0000 (-0300) Subject: Allow testsuite to run on Windows X-Git-Tag: v3.1~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41fc0ed3e212072c8a705f2a0e556e1cb453ca14;p=thirdparty%2Fccache.git Allow testsuite to run on Windows 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. --- diff --git a/test.sh b/test.sh index ace9efa80..016178da9 100755 --- 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