Skip to content

Commit 6cce4e5

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 9fa26f1 commit 6cce4e5

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

config.mak.uname

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,62 @@ else
694694
NO_CURL = YesPlease
695695
endif
696696
endif
697+
ifeq (i686,$(uname_M))
698+
MINGW_PREFIX := mingw32
699+
endif
700+
ifeq (x86_64,$(uname_M))
701+
MINGW_PREFIX := mingw64
702+
endif
703+
704+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
705+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
706+
install-mingit-test-artifacts:
707+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
708+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
709+
"#!/mingw64/bin/busybox sh" \
710+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
711+
712+
install -m755 -d '$(DESTDIR_SQ)'
713+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
714+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
715+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
716+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
717+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
718+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
719+
"@echo Now, run 'helper\\test-run-command testsuite'"
720+
721+
install -m755 -d '$(DESTDIR_SQ)/test-git'
722+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
723+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
724+
725+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
726+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
727+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] lib-diff) | \
728+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
729+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
730+
731+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
732+
(cd templates && $(TAR) cf - blt) | \
733+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
734+
735+
# po/build/locale for t0200
736+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
737+
(cd po/build/locale && $(TAR) cf - .) | \
738+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
739+
740+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
741+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
742+
install -m755 git-daemon.exe git-http-backend.exe \
743+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
744+
745+
# git-upload-archive (dashed) for t5000
746+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
747+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
748+
749+
# git-difftool--helper for t7800
750+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
751+
install -m755 git-difftool--helper \
752+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
697753
endif
698754
ifeq ($(uname_S),QNX)
699755
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)