From fbbfc8a9bb91ddd325995cc346eab91c06c9cd64 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 14 Dec 2010 18:19:09 +0000 Subject: t3600-rm.sh: Don't pass a non-existent prereq to test #15 Commit c91cfd19 (tests: A SANITY test prereq for testing if we're root, 2010-08-06) introduced a SANITY prerequisite which had very similar semantics to RO_DIR. That commit removed the code to set RO_DIR, but forgot to replace RO_DIR with SANITY in test #15. In order not to skip test 15 unnecessarily, since RO_DIR will never be set, we pass the SANITY prerequisite instead. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- t/t3600-rm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index b26cabd571..cd093bd347 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -96,7 +96,7 @@ test_expect_success FUNNYNAMES \ "git rm -f 'space embedded' 'tab embedded' 'newline embedded'" -test_expect_success RO_DIR 'Test that "git rm -f" fails if its rm fails' ' +test_expect_success SANITY 'Test that "git rm -f" fails if its rm fails' ' chmod a-w . && test_must_fail git rm -f baz && chmod 775 . -- cgit v1.2.1 From 531dd7bbf4e579334cddb5be54af94c8d339df10 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 14 Dec 2010 18:20:38 +0000 Subject: t9142: Move call to start_httpd into the setup test In addition to being more consistent with the other calls to start_httpd in tests t9115-*.sh, t9118-*.sh and t9120-*.sh, this has the added benefit of making the test less noisy. (start_httpd writes "SVN_HTTPD_PORT is not defined!" on stderr.) Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- t/t9142-git-svn-shallow-clone.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/t9142-git-svn-shallow-clone.sh b/t/t9142-git-svn-shallow-clone.sh index 1236accd99..e21ee5f663 100755 --- a/t/t9142-git-svn-shallow-clone.sh +++ b/t/t9142-git-svn-shallow-clone.sh @@ -17,11 +17,10 @@ test_expect_success 'setup test repository' ' > foo && svn_cmd add foo && svn_cmd commit -m "add foo" - ) + ) && + start_httpd ' -start_httpd - test_expect_success 'clone trunk with "-r HEAD"' ' git svn clone -r HEAD "$svnrepo/trunk" g && ( cd g && git rev-parse --symbolic --verify HEAD ) -- cgit v1.2.1 From b6fe97483fdfec2176cf17dd38821cad0200a126 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 14 Dec 2010 18:22:29 +0000 Subject: lib-git-svn.sh: Avoid setting web server variables unnecessarily If the SVN_HTTPD_PORT variable is not set, then we will not even attempt to start a web server in the start_httpd function (despite it's name), so there is no need to determine values for the SVN_HTTPD_PATH and SVN_HTTPD_MODULE_PATH variables. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- t/lib-git-svn.sh | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh index 92d6d31942..919d45a7d4 100644 --- a/t/lib-git-svn.sh +++ b/t/lib-git-svn.sh @@ -68,28 +68,31 @@ svn_cmd () { svn "$orig_svncmd" --config-dir "$svnconf" "$@" } -for d in \ - "$SVN_HTTPD_PATH" \ - /usr/sbin/apache2 \ - /usr/sbin/httpd \ -; do - if test -f "$d" - then - SVN_HTTPD_PATH="$d" - break - fi -done -for d in \ - "$SVN_HTTPD_MODULE_PATH" \ - /usr/lib/apache2/modules \ - /usr/libexec/apache2 \ -; do - if test -d "$d" - then - SVN_HTTPD_MODULE_PATH="$d" - break - fi -done +if test -n "$SVN_HTTPD_PORT" +then + for d in \ + "$SVN_HTTPD_PATH" \ + /usr/sbin/apache2 \ + /usr/sbin/httpd \ + ; do + if test -f "$d" + then + SVN_HTTPD_PATH="$d" + break + fi + done + for d in \ + "$SVN_HTTPD_MODULE_PATH" \ + /usr/lib/apache2/modules \ + /usr/libexec/apache2 \ + ; do + if test -d "$d" + then + SVN_HTTPD_MODULE_PATH="$d" + break + fi + done +fi start_httpd () { repo_base_path="$1" -- cgit v1.2.1 From cff484a98baf57f11daed62744bcf0774bd78c2f Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 14 Dec 2010 18:25:11 +0000 Subject: lib-git-svn.sh: Add check for mis-configured web server variables Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- t/lib-git-svn.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh index 919d45a7d4..6a9d975723 100644 --- a/t/lib-git-svn.sh +++ b/t/lib-git-svn.sh @@ -81,6 +81,11 @@ then break fi done + if test -z "$SVN_HTTPD_PATH" + then + skip_all='skipping git svn tests, Apache not found' + test_done + fi for d in \ "$SVN_HTTPD_MODULE_PATH" \ /usr/lib/apache2/modules \ @@ -92,6 +97,11 @@ then break fi done + if test -z "$SVN_HTTPD_MODULE_PATH" + then + skip_all='skipping git svn tests, Apache module dir not found' + test_done + fi fi start_httpd () { -- cgit v1.2.1 From 1b3187ba6efdb216a9b45dac087aa4bfba0b90ae Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 14 Dec 2010 18:26:38 +0000 Subject: t9501-*.sh: Fix a test failure on Cygwin The first (setup) test attempts to create a file, using the test_commit function, called 'i can has snapshot?'. On cygwin (and MinGW) this fails with a "No such file or directory" error. In order to fix the tests, we simply remove the '?' wildcard from the name, since the purpose of these tests is not about creating funny filenames. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- t/t9501-gitweb-standalone-http-status.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh index 2487da1296..18825aff89 100755 --- a/t/t9501-gitweb-standalone-http-status.sh +++ b/t/t9501-gitweb-standalone-http-status.sh @@ -16,7 +16,7 @@ code and message.' # snapshot settings test_expect_success 'setup' " - test_commit 'SnapshotTests' 'i can has snapshot?' + test_commit 'SnapshotTests' 'i can has snapshot' " -- cgit v1.2.1