Skip to content

Commit ed4d0cd

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 aa118d6 commit ed4d0cd

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

config.mak.uname

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,72 @@ else
685685
NO_CURL = YesPlease
686686
endif
687687
endif
688+
ifeq (i686,$(uname_M))
689+
MINGW_PREFIX := mingw32
690+
endif
691+
ifeq (x86_64,$(uname_M))
692+
MINGW_PREFIX := mingw64
693+
endif
694+
695+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
696+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
697+
install-mingit-test-artifacts:
698+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
699+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
700+
"#!/mingw64/bin/busybox sh" \
701+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
702+
703+
install -m755 -d '$(DESTDIR_SQ)'
704+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
705+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
706+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
707+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
708+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
709+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
710+
"@echo Now, run 'helper\\test-run-command testsuite'"
711+
712+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
713+
install -m755 git.exe git-credential-store.exe git-fast-import.exe \
714+
git-http-fetch.exe git-http-push.exe git-receive-pack.exe \
715+
git-remote-http.exe git-remote-https.exe \
716+
git-sh-i18n--envsubst.exe git-show-index.exe \
717+
git-upload-pack.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
718+
719+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
720+
cp git-bisect git-difftool--helper git-filter-branch git-instaweb \
721+
git-merge-octopus git-merge-one-file git-merge-resolve \
722+
git-mergetool git-mergetool--lib git-parse-remote \
723+
git-quiltimport git-rebase git-rebase--am \
724+
git-rebase--interactive git-rebase--merge git-request-pull \
725+
git-sh-i18n git-sh-setup git-stash git-submodule \
726+
git-web--browse '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
727+
728+
install -m755 -d '$(DESTDIR_SQ)/test-git'
729+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
730+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
731+
732+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
733+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
734+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] diff-lib) | \
735+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
736+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
737+
738+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
739+
(cd templates && $(TAR) cf - blt) | \
740+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
741+
742+
# po/build/locale for t0200
743+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
744+
(cd po/build/locale && $(TAR) cf - .) | \
745+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
746+
747+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
748+
install -m755 git-daemon.exe git-http-backend.exe \
749+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
750+
751+
# git-remote-testgit for t5801
752+
install -m755 git-remote-testgit \
753+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
688754
endif
689755
ifeq ($(uname_S),QNX)
690756
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)