Skip to content

Commit

Permalink
Merge branch 'jk/test-ports'
Browse files Browse the repository at this point in the history
Avoid having to assign port number to be used in tests manually.

* jk/test-ports:
  tests: auto-set git-daemon port
  tests: auto-set LIB_HTTPD_PORT from test name
  • Loading branch information
Junio C Hamano committed Feb 27, 2014
2 parents 8336832 + c44132f commit bd62e7c
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion t/lib-git-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ then
test_done
fi

LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-'8121'}
LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-${this_test#t}}

GIT_DAEMON_PID=
GIT_DAEMON_DOCUMENT_ROOT_PATH="$PWD"/repo
Expand Down
2 changes: 1 addition & 1 deletion t/lib-httpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ case $(uname) in
esac

LIB_HTTPD_PATH=${LIB_HTTPD_PATH-"$DEFAULT_HTTPD_PATH"}
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-${this_test#t}}

TEST_PATH="$TEST_DIRECTORY"/lib-httpd
HTTPD_ROOT_PATH="$PWD"/httpd
Expand Down
1 change: 0 additions & 1 deletion t/t5537-fetch-shallow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
test_done
fi

LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd

Expand Down
1 change: 0 additions & 1 deletion t/t5538-push-shallow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
test_done
fi

LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd

Expand Down
1 change: 0 additions & 1 deletion t/t5540-http-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ then
fi

LIB_HTTPD_DAV=t
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5540'}
. "$TEST_DIRECTORY"/lib-httpd.sh
ROOT_PATH="$PWD"
start_httpd
Expand Down
1 change: 0 additions & 1 deletion t/t5541-http-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if test -n "$NO_CURL"; then
fi

ROOT_PATH="$PWD"
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'}
. "$TEST_DIRECTORY"/lib-httpd.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
start_httpd
Expand Down
1 change: 0 additions & 1 deletion t/t5550-http-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
test_done
fi

LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd

Expand Down
1 change: 0 additions & 1 deletion t/t5551-http-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
test_done
fi

LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5551'}
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd

Expand Down
1 change: 0 additions & 1 deletion t/t5561-http-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
test_done
fi

LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5561'}
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd

Expand Down
1 change: 0 additions & 1 deletion t/t5570-git-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
test_description='test fetching over git protocol'
. ./test-lib.sh

LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-5570}
. "$TEST_DIRECTORY"/lib-git-daemon.sh
start_git_daemon

Expand Down

0 comments on commit bd62e7c

Please sign in to comment.