Skip to content

Commit 4664221

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 86d5f7f commit 4664221

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

0 commit comments

Comments
 (0)