Skip to content

Commit 813b5be

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 6370728 commit 813b5be

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

0 commit comments

Comments
 (0)