Skip to content

Commit 3ec7b46

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 44ce724 commit 3ec7b46

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

0 commit comments

Comments
 (0)