Skip to content

Commit 567d6c8

Browse files
committed
mingw: add a Makefile target to copy test artifacts
The Makefile target `install-mingit-test-artifacts` simply copies stuff and things directly into a MinGit directory, including an init.bat script to set everything up so that the tests can be run in a cmd window. Sadly, Git's test suite still relies on a Perl interpreter even if compiled with NO_PERL=YesPlease. We punt for now, installing a small script into /usr/bin/perl that hands off to an existing Perl of a Git for Windows SDK. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b2e20a0 commit 567d6c8

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

config.mak.uname

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,65 @@ else
664664
NO_CURL = YesPlease
665665
endif
666666
endif
667+
ifeq (i686,$(uname_M))
668+
MINGW_PREFIX := mingw32
669+
endif
670+
ifeq (x86_64,$(uname_M))
671+
MINGW_PREFIX := mingw64
672+
endif
673+
674+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
675+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
676+
install-mingit-test-artifacts:
677+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
678+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
679+
"#!/mingw64/bin/busybox sh" \
680+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
681+
682+
install -m755 -d '$(DESTDIR_SQ)'
683+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
684+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
685+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
686+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
687+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
688+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
689+
"@echo Now, run 'helper\\test-run-command testsuite'"
690+
691+
install -m755 -d '$(DESTDIR_SQ)/test-git'
692+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
693+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
694+
695+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
696+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
697+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] diff-lib) | \
698+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
699+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
700+
701+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
702+
(cd templates && $(TAR) cf - blt) | \
703+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
704+
705+
# po/build/locale for t0200
706+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
707+
(cd po/build/locale && $(TAR) cf - .) | \
708+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
709+
710+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
711+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
712+
install -m755 git-daemon.exe git-http-backend.exe \
713+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
714+
715+
# git-remote-testgit for t5801
716+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
717+
install -m755 git-remote-testgit \
718+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
719+
720+
# git-upload-archive (dashed) for t5000
721+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
722+
723+
# git-difftool--helper for t7800
724+
install -m755 git-difftool--helper \
725+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
667726
endif
668727
ifeq ($(uname_S),QNX)
669728
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)