From f1ec72ba1e52783179a7da7defaab0458c895617 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Wed, 28 Dec 2005 12:25:38 +0100 Subject: Fix skipping merge-order test with NO_OPENSSL=1. Move git-rev-list --merge-order usage check for 'OpenSSL not linked' after test 1; we cannot trigger this unless we try to actually use --merge-order by giving some ref, and we do not have any ref until we run the first test to create commits. Signed-off-by: Gerrit Pape Signed-off-by: Junio C Hamano --- t/t6001-rev-list-merge-order.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 't') diff --git a/t/t6001-rev-list-merge-order.sh b/t/t6001-rev-list-merge-order.sh index 368b8d9e0..7724e8a8c 100755 --- a/t/t6001-rev-list-merge-order.sh +++ b/t/t6001-rev-list-merge-order.sh @@ -8,13 +8,6 @@ test_description='Tests git-rev-list --merge-order functionality' . ./test-lib.sh . ../t6000lib.sh # t6xxx specific functions -if git-rev-list --merge-order 2>&1 | grep 'OpenSSL not linked' >/dev/null -then - test_expect_success 'skipping merge-order test' : - test_done - exit -fi - # test-case specific test function check_adjacency() { @@ -114,6 +107,13 @@ test_output_expect_success 'rev-list has correct number of entries' 'git-rev-lis 19 EOF +if git-rev-list --merge-order HEAD 2>&1 | grep 'OpenSSL not linked' >/dev/null +then + test_expect_success 'skipping merge-order test' : + test_done + exit +fi + normal_adjacency_count=$(git-rev-list HEAD | check_adjacency | grep -c "\^" | tr -d ' ') merge_order_adjacency_count=$(git-rev-list --merge-order HEAD | check_adjacency | grep -c "\^" | tr -d ' ') test_expect_success '--merge-order produces as many or fewer discontinuities' '[ $merge_order_adjacency_count -le $normal_adjacency_count ]' -- cgit v1.2.1 From e58b97af31779a4db84877082ef619f0e3bd1d6c Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:55:03 +0100 Subject: trivial: use git-repo-config to detect if the test can be run on the repository Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- t/t4000-diff-format.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't') diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh index beb6d8f48..67b9681d3 100755 --- a/t/t4000-diff-format.sh +++ b/t/t4000-diff-format.sh @@ -26,6 +26,14 @@ rm -f path1 test_expect_success \ 'git-diff-files -p after editing work tree.' \ 'git-diff-files -p >current' + +# that's as far as it comes +if [ "$(git repo-config --get core.filemode)" = false ] +then + say 'filemode disabled on the filesystem' + test_done +fi + cat >expected <<\EOF diff --git a/path0 b/path0 old mode 100644 -- cgit v1.2.1 From b484ef28fbdc3e2ac242c37507eee5ace90f3915 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:55:58 +0100 Subject: trivial: use git-repo-config to detect how to run tests in the test repository Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- t/t4006-diff-mode.sh | 20 +++++++++++++++----- t/t4102-apply-rename.sh | 9 +++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 't') diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh index e2a67e963..8ad69d111 100755 --- a/t/t4006-diff-mode.sh +++ b/t/t4006-diff-mode.sh @@ -15,11 +15,21 @@ test_expect_success \ tree=`git-write-tree` && echo $tree' -test_expect_success \ - 'chmod' \ - 'chmod +x rezrov && - git-update-index rezrov && - git-diff-index $tree >current' +if [ "$(git repo-config --get core.filemode)" = false ] +then + say 'filemode disabled on the filesystem, using update-index --chmod=+x' + test_expect_success \ + 'git-update-index --chmod=+x' \ + 'git-update-index rezrov && + git-update-index --chmod=+x rezrov && + git-diff-index $tree >current' +else + test_expect_success \ + 'chmod' \ + 'chmod +x rezrov && + git-update-index rezrov && + git-diff-index $tree >current' +fi _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh index 0401d7bbc..fbb508d38 100755 --- a/t/t4102-apply-rename.sh +++ b/t/t4102-apply-rename.sh @@ -31,7 +31,12 @@ test_expect_success setup \ test_expect_success apply \ 'git-apply --index --stat --summary --apply test-patch' -test_expect_success validate \ - 'test -f bar && ls -l bar | grep "^-..x......"' +if [ "$(git repo-config --get core.filemode)" = false ] +then + say 'filemode disabled on the filesystem' +else + test_expect_success validate \ + 'test -f bar && ls -l bar | grep "^-..x......"' +fi test_done -- cgit v1.2.1 From 2ccd2027b012f481018b9a95929fa8df6ce1d33f Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:57:36 +0100 Subject: trivial: check, if t/trash directory was successfully created and was successfully entered. Otherwise git-init-db will create it directly in the working directory (t/) which can be dangerous. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/test-lib.sh b/t/test-lib.sh index a97d259e2..7534a7620 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -195,7 +195,7 @@ test -d ../templates/blt || { test=trash rm -fr "$test" mkdir "$test" -cd "$test" +cd "$test" || error "Cannot setup test environment" "$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null || error "cannot run git init-db -- have you built things yet?" -- cgit v1.2.1 From 6ce183216d6c4b234d4515c21a864615cd278d0b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 5 Jan 2006 20:14:40 -0800 Subject: t3300: skip when filesystem does not like TAB in filenames. Instead of checking Cygwin explicitly, see if the filesystem lets us create funny filenames. Signed-off-by: Junio C Hamano --- t/t3300-funny-names.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh index 6a85d67c5..72a93da08 100755 --- a/t/t3300-funny-names.sh +++ b/t/t3300-funny-names.sh @@ -9,9 +9,6 @@ This test tries pathnames with funny characters in the working tree, index, and tree objects. ' -# since FAT/NTFS does not allow tabs in filenames, skip this test -test "$(uname -o 2>/dev/null)" = Cygwin && exit 0 - . ./test-lib.sh p0='no-funny' @@ -27,6 +24,12 @@ EOF cat >"$p1" "$p0" echo 'Foo Bar Baz' >"$p2" +test -f "$p1" && cmp "$p0" "$p1" || { + # since FAT/NTFS does not allow tabs in filenames, skip this test + say 'Your filesystem does not allow tabs in filenames, test skipped.' + test_done +} + echo 'just space no-funny' >expected test_expect_success 'git-ls-files no-funny' \ -- cgit v1.2.1