Skip to content

Commit d654771

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 efeafe7 commit d654771

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
@@ -646,6 +646,65 @@ else
646646
NO_CURL = YesPlease
647647
endif
648648
endif
649+
ifeq (i686,$(uname_M))
650+
MINGW_PREFIX := mingw32
651+
endif
652+
ifeq (x86_64,$(uname_M))
653+
MINGW_PREFIX := mingw64
654+
endif
655+
656+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
657+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
658+
install-mingit-test-artifacts:
659+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
660+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
661+
"#!/mingw64/bin/busybox sh" \
662+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
663+
664+
install -m755 -d '$(DESTDIR_SQ)'
665+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
666+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
667+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
668+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
669+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
670+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
671+
"@echo Now, run 'helper\\test-run-command testsuite'"
672+
673+
install -m755 -d '$(DESTDIR_SQ)/test-git'
674+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
675+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
676+
677+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
678+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
679+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] diff-lib) | \
680+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
681+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
682+
683+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
684+
(cd templates && $(TAR) cf - blt) | \
685+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
686+
687+
# po/build/locale for t0200
688+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
689+
(cd po/build/locale && $(TAR) cf - .) | \
690+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
691+
692+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
693+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
694+
install -m755 git-daemon.exe git-http-backend.exe \
695+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
696+
697+
# git-remote-testgit for t5801
698+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
699+
install -m755 git-remote-testgit \
700+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
701+
702+
# git-upload-archive (dashed) for t5000
703+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
704+
705+
# git-difftool--helper for t7800
706+
install -m755 git-difftool--helper \
707+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
649708
endif
650709
ifeq ($(uname_S),QNX)
651710
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)