From 4dd396c27837e7ea4cd629af2ea4c37d976efa62 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Mon, 5 Nov 2012 02:54:09 +0000 Subject: [PATCH] Cygwin changes. --- test/functions.source | 16 ++++++++++++---- test/testMSVC.sh | 7 +++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/test/functions.source b/test/functions.source index 9de060ae..d05537f8 100644 --- a/test/functions.source +++ b/test/functions.source @@ -1,10 +1,11 @@ #!/bin/bash -#locale setting +## +# locale setting +export LC_ALL=C ## # initialize globals -export LC_ALL=C this=$(basename $0 .sh) here=$PWD @@ -16,7 +17,7 @@ else fi exe=$(uname) -if [ $exe==cygwin -o $exe==mingw ]; then +if [ "${os:0:4}" == "CYGW" -o $exe==mingw ]; then exe=.exe else unset exe @@ -107,7 +108,11 @@ reportTest() fi fi - diff -q $diffargs $lhs $rhs + if [ "$PLATFORM" == "cygwin" ]; then + diff -q $diffargs $(cygpath -aw $lhs) $(cygpath -aw $rhs) + else + diff -q $diffargs $lhs $rhs + fi rc=$? if [ $rc -eq 0 ] ; then echo "all testcases passed." @@ -242,6 +247,9 @@ prepareTest() os=$(uname) if [ "${os:0:4}" == "CYGW" ]; then export "PATH=$PWD/../msvc:$PATH" + export PLATFORM=cygwin + else + export PLATFORM=$os fi tmpfile=$here/tmp/$this diff --git a/test/testMSVC.sh b/test/testMSVC.sh index 5934be07..445cc20a 100755 --- a/test/testMSVC.sh +++ b/test/testMSVC.sh @@ -9,6 +9,13 @@ if [ -z $msvc ]; then exit fi +if [ ! -d "$msvc" ]; then + echo directory "$msvc" does not exist + exit +else + msvc=$(readlink -f "$msvc") +fi + if [ -z $test ]; then test=tests fi