[PATCH 2/2] remote-helpers: move tests out of contrib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



They should be tested by default.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 contrib/remote-helpers/Makefile                            | 14 --------------
 t/Makefile                                                 |  8 +++++++-
 .../remote-helpers/test-bzr.sh => t/remote-helpers/bzr.t   |  2 +-
 .../test-hg-bidi.sh => t/remote-helpers/hg-bidi.t          |  2 +-
 .../test-hg-hg-git.sh => t/remote-helpers/hg-hg-git.t      |  2 +-
 contrib/remote-helpers/test-hg.sh => t/remote-helpers/hg.t |  2 +-
 6 files changed, 11 insertions(+), 19 deletions(-)
 delete mode 100644 contrib/remote-helpers/Makefile
 rename contrib/remote-helpers/test-bzr.sh => t/remote-helpers/bzr.t (99%)
 rename contrib/remote-helpers/test-hg-bidi.sh => t/remote-helpers/hg-bidi.t (98%)
 rename contrib/remote-helpers/test-hg-hg-git.sh => t/remote-helpers/hg-hg-git.t (99%)
 rename contrib/remote-helpers/test-hg.sh => t/remote-helpers/hg.t (99%)

diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
deleted file mode 100644
index 239161d..0000000
--- a/contrib/remote-helpers/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-TESTS := $(wildcard test*.sh)
-
-export T := $(addprefix $(CURDIR)/,$(TESTS))
-export MAKE := $(MAKE) -e
-export PATH := $(CURDIR):$(PATH)
-export TEST_LINT := test-lint-executable test-lint-shell-syntax
-
-test:
-	$(MAKE) -C ../../t $@
-
-$(TESTS):
-	$(MAKE) -C ../../t $(CURDIR)/$@
-
-.PHONY: $(TESTS)
diff --git a/t/Makefile b/t/Makefile
index 8fd1a72..818f4ed 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -14,6 +14,7 @@ RM ?= rm -f
 PROVE ?= prove
 DEFAULT_TEST_TARGET ?= test
 TEST_LINT ?= test-lint-duplicates test-lint-executable
+export TEST_DIRECTORY = $(CURDIR)
 
 ifdef TEST_OUTPUT_DIRECTORY
 TEST_RESULTS_DIRECTORY = $(TEST_OUTPUT_DIRECTORY)/test-results
@@ -29,6 +30,9 @@ TEST_RESULTS_DIRECTORY_SQ = $(subst ','\'',$(TEST_RESULTS_DIRECTORY))
 T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
 TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
 TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
+TREMOTE = $(wildcard remote-helpers/*.t)
+
+T += $(TREMOTE)
 
 all: $(DEFAULT_TEST_TARGET)
 
@@ -55,7 +59,7 @@ clean: clean-except-prove-cache
 test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
 
 test-lint-duplicates:
-	@dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
+	@dups=`echo $(filter-out $(TREMOTE),$(T)) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
 		test -z "$$dups" || { \
 		echo >&2 "duplicate test numbers:" $$dups; exit 1; }
 
@@ -84,6 +88,8 @@ full-svn-test:
 gitweb-test:
 	$(MAKE) $(TGITWEB)
 
+remote-helpers-test: $(TREMOTE)
+
 valgrind:
 	$(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind"
 
diff --git a/contrib/remote-helpers/test-bzr.sh b/t/remote-helpers/bzr.t
similarity index 99%
rename from contrib/remote-helpers/test-bzr.sh
rename to t/remote-helpers/bzr.t
index 330b147..066e326 100755
--- a/contrib/remote-helpers/test-bzr.sh
+++ b/t/remote-helpers/bzr.t
@@ -5,7 +5,7 @@
 
 test_description='Test remote-bzr'
 
-test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/..
 . "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
diff --git a/contrib/remote-helpers/test-hg-bidi.sh b/t/remote-helpers/hg-bidi.t
similarity index 98%
rename from contrib/remote-helpers/test-hg-bidi.sh
rename to t/remote-helpers/hg-bidi.t
index e963745..f6c51b0 100755
--- a/contrib/remote-helpers/test-hg-bidi.sh
+++ b/t/remote-helpers/hg-bidi.t
@@ -8,7 +8,7 @@
 
 test_description='Test bidirectionality of remote-hg'
 
-test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/..
 . "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/t/remote-helpers/hg-hg-git.t
similarity index 99%
rename from contrib/remote-helpers/test-hg-hg-git.sh
rename to t/remote-helpers/hg-hg-git.t
index c6b4541..12e2d51 100755
--- a/contrib/remote-helpers/test-hg-hg-git.sh
+++ b/t/remote-helpers/hg-hg-git.t
@@ -8,7 +8,7 @@
 
 test_description='Test remote-hg output compared to hg-git'
 
-test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/..
 . "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
diff --git a/contrib/remote-helpers/test-hg.sh b/t/remote-helpers/hg.t
similarity index 99%
rename from contrib/remote-helpers/test-hg.sh
rename to t/remote-helpers/hg.t
index 00b7dde..b4f26e7 100755
--- a/contrib/remote-helpers/test-hg.sh
+++ b/t/remote-helpers/hg.t
@@ -8,7 +8,7 @@
 
 test_description='Test remote-hg'
 
-test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/..
 . "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
-- 
1.9.1+fc3.9.gc73078e

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]