Skip to content

Commit d7a291b

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 de1bfaf commit d7a291b

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

config.mak.uname

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

0 commit comments

Comments
 (0)