Skip to content

Commit b6e2e58

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 14f4333 commit b6e2e58

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
@@ -676,6 +676,62 @@ else
676676
NO_CURL = YesPlease
677677
endif
678678
endif
679+
ifeq (i686,$(uname_M))
680+
MINGW_PREFIX := mingw32
681+
endif
682+
ifeq (x86_64,$(uname_M))
683+
MINGW_PREFIX := mingw64
684+
endif
685+
686+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
687+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
688+
install-mingit-test-artifacts:
689+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
690+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
691+
"#!/mingw64/bin/busybox sh" \
692+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
693+
694+
install -m755 -d '$(DESTDIR_SQ)'
695+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
696+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
697+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
698+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
699+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
700+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
701+
"@echo Now, run 'helper\\test-run-command testsuite'"
702+
703+
install -m755 -d '$(DESTDIR_SQ)/test-git'
704+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
705+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
706+
707+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
708+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
709+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] diff-lib) | \
710+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
711+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
712+
713+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
714+
(cd templates && $(TAR) cf - blt) | \
715+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
716+
717+
# po/build/locale for t0200
718+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
719+
(cd po/build/locale && $(TAR) cf - .) | \
720+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
721+
722+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
723+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
724+
install -m755 git-daemon.exe git-http-backend.exe \
725+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
726+
727+
# git-upload-archive (dashed) for t5000
728+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
729+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
730+
731+
# git-difftool--helper for t7800
732+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
733+
install -m755 git-difftool--helper \
734+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
679735
endif
680736
ifeq ($(uname_S),QNX)
681737
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)