Skip to contentSkip to conversation

Fix regression tests on Cygwin

PATCH In review Lars Hjemli 3 participants 5 messages Jun 15, 2016 – Aug 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix regression tests on Cygwin

On Cygwin, "make test" failes due to missing ".exe" a couple of places.

This fixes it, in a somewhat ugly way....

---
 t/t0000-basic.sh |    9 ++++++++-
 t/test-lib.sh    |   10 +++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)
t/t0000-basic.sh +8 -1
index 2c9bbb5..41d53be 100755
@@ -25,7 +25,14 @@ # or have too old python without subproc
 # out before running any tests.  Also catch the bogosity of trying
 # to run tests without building while we are at it.
 
-../git >/dev/null
+X=
+uname=$(uname -o)
+if test "$uname" = "Cygwin"
+then
+	X=".exe"
+fi
+
+../git$X >/dev/null
 if test $? != 1
 then
 	echo >&2 'You do not seem to have built git yet.'
t/test-lib.sh +9 -1
index 2488e6e..8a64f6e 100755
@@ -43,6 +43,14 @@ case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z
 		;;
 esac
 
+X=
+uname=$(uname -o)
+if test "$uname" = "Cygwin"
+then
+	X=".exe"
+fi
+
+
 # Each test should start with something like this, after copyright notices:
 #
 # test_description='Description of this test...
@@ -175,7 +183,7 @@ test_create_repo () {
 	repo="$1"
 	mkdir "$repo"
 	cd "$repo" || error "Cannot setup test environment"
-	"$GIT_EXEC_PATH/git" init-db --template=$GIT_EXEC_PATH/templates/blt/ 2>/dev/null ||
+	"$GIT_EXEC_PATH/git$X" init-db --template=$GIT_EXEC_PATH/templates/blt/ 2>/dev/null ||
 	error "cannot run git init-db -- have you built things yet?"
 	mv .git/hooks .git/hooks-disabled
 	cd "$owd"
Signature · 1 line
1.4.3.1.g1688
#1 lore raw

Hi,

Quoted 1 line · Lars Hjemli

On Cygwin, "make test" failes due to missing ".exe" a couple of places.

Last time I made "test" on cygwin, it did not complain. "../git" works perfectly here.

Ciao,
Dscho

#2 lore raw
Quoted 5 lines · Johannes Schindelin
Quoted 1 line · Lars Hjemli

On Cygwin, "make test" failes due to missing ".exe" a couple of places.

Last time I made "test" on cygwin, it did not complain.

Same here (W2k, fairly up-to-date git, installed on local NTFS disk).

#3 lore raw
Quoted 10 lines · Junio C Hamano
Quoted 5 lines · Johannes Schindelin
Quoted 1 line · Lars Hjemli

On Cygwin, "make test" failes due to missing ".exe" a couple of places.

Last time I made "test" on cygwin, it did not complain.

Same here (W2k, fairly up-to-date git, installed on local NTFS disk).

... and more importantly, with fairly up-to-date Cygwin.

#4 lore raw
Quoted 4 lines · Junio C Hamano
Quoted 2 lines · Junio C Hamano

Johannes Schindelin <[email protected]> writes:

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines · Lars Hjemli
Quoted 2 lines

On Cygwin, "make test" failes due to missing ".exe" a couple of places.

Last time I made "test" on cygwin, it did not complain.

Same here (W2k, fairly up-to-date git, installed on local NTFS disk).

Well, then it's probably my cygwin-environment that is broken (make test used to work for me too...)

Sorry for the noise

--