| 1 |
SHELL = bash |
| 2 |
RM ?= rm -f |
| 3 |
PROVE ?= prove |
| 4 |
PROVE_EXTRA_ARGS = |
| 5 |
DEFAULT_TEST_TARGET ?= test |
| 6 |
|
| 7 |
GO ?= go |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
export GOTOOLCHAIN = local |
| 12 |
|
| 13 |
ifeq ($(OS),Windows_NT) |
| 14 |
X ?= .exe |
| 15 |
else |
| 16 |
X ?= |
| 17 |
endif |
| 18 |
|
| 19 |
TEST_CMDS = |
| 20 |
|
| 21 |
TEST_CMDS += ../bin/git-credential-lfsnoop$X |
| 22 |
TEST_CMDS += ../bin/git-credential-lfstest$X |
| 23 |
TEST_CMDS += ../bin/lfs-askpass$X |
| 24 |
TEST_CMDS += ../bin/lfs-ssh-echo$X |
| 25 |
TEST_CMDS += ../bin/lfs-ssh-proxy-test$X |
| 26 |
TEST_CMDS += ../bin/lfstest-badlocalfile$X |
| 27 |
TEST_CMDS += ../bin/lfstest-badpathcheck$X |
| 28 |
TEST_CMDS += ../bin/lfstest-caseinverterextension$X |
| 29 |
TEST_CMDS += ../bin/lfstest-count-tests$X |
| 30 |
TEST_CMDS += ../bin/lfstest-customadapter$X |
| 31 |
TEST_CMDS += ../bin/lfstest-genrandom$X |
| 32 |
TEST_CMDS += ../bin/lfstest-getlimit$X |
| 33 |
TEST_CMDS += ../bin/lfstest-getnumcpu$X |
| 34 |
TEST_CMDS += ../bin/lfstest-gitserver$X |
| 35 |
TEST_CMDS += ../bin/lfstest-nanomtime$X |
| 36 |
TEST_CMDS += ../bin/lfstest-realpath$X |
| 37 |
TEST_CMDS += ../bin/lfstest-standalonecustomadapter$X |
| 38 |
TEST_CMDS += ../bin/lfstest-testutils$X |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
TEST_CMDS += ../bin/git-lfs-test-server-api$X |
| 43 |
|
| 44 |
TEST_SRCS = $(wildcard t-*.sh) |
| 45 |
TEST_API_SRCS = $(wildcard git-lfs-test-server-api/*.go) |
| 46 |
|
| 47 |
all : $(DEFAULT_TEST_TARGET) |
| 48 |
|
| 49 |
test-commands : $(TEST_CMDS) |
| 50 |
|
| 51 |
test : test-commands |
| 52 |
$(RM) -r remote test_count{,.lock} |
| 53 |
@. ./testenv.sh && setup && cd t && \ |
| 54 |
RM_GIT_LFS_TEST_DIR=no $(PROVE) $(PROVE_EXTRA_ARGS) t-*.sh && \ |
| 55 |
shutdown |
| 56 |
|
| 57 |
.PHONY : $(TEST_SRCS) |
| 58 |
$(TEST_SRCS) : $(TEST_CMDS) |
| 59 |
$(RM) -r remote test_count{,.lock} |
| 60 |
$(PROVE) -v $(PROVE_EXTRA_ARGS) $@ |
| 61 |
|
| 62 |
.PHONY : clean |
| 63 |
clean : |
| 64 |
$(RM) -r remote |
| 65 |
$(RM) $(TEST_CMDS) |
| 66 |
|
| 67 |
../bin/%$X : cmd/%.go |
| 68 |
$(GO) build -o $@ $^ |
| 69 |
|
| 70 |
../bin/git-lfs-test-server-api$X : $(TEST_API_SRCS) |
| 71 |
$(GO) build -o $@ $^ |