From: Christian Couder Date: Tue, 17 Apr 2007 04:51:48 +0000 (+0200) Subject: Bisect: rename "t/t6030-bisect-run.sh" to "t/t6030-bisect-porcelain.sh". X-Git-Tag: v1.5.2-rc0~41 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f948792990f82a35bf0c98510e7511ef8acb9cd3;p=git.git Bisect: rename "t/t6030-bisect-run.sh" to "t/t6030-bisect-porcelain.sh". [jc: also fix 0a5280a9 that incorrectly changed the title of one test.] Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh new file mode 100755 index 000000000..13e937923 --- /dev/null +++ b/t/t6030-bisect-porcelain.sh @@ -0,0 +1,102 @@ +#!/bin/sh +# +# Copyright (c) 2007 Christian Couder +# +test_description='Tests git-bisect functionality' + +exec > $_file || return $? + MSG="Add <$_line> into <$_file>." + else + echo "$_line" > $_file || return $? + git add $_file || return $? + MSG="Create file <$_file> with <$_line> inside." + fi + + git-commit -m "$MSG" $_file +} + +HASH1= +HASH3= +HASH4= + +test_expect_success \ + 'set up basic repo with 1 file (hello) and 4 commits' \ + 'add_line_into_file "1: Hello World" hello && + add_line_into_file "2: A new day for git" hello && + add_line_into_file "3: Another new day for git" hello && + add_line_into_file "4: Ciao for now" hello && + HASH1=$(git rev-list HEAD | tail -1) && + HASH3=$(git rev-list HEAD | head -2 | tail -1) && + HASH4=$(git rev-list HEAD | head -1)' + +test_expect_success 'bisect starts with only one bad' ' + git bisect reset && + git bisect start && + git bisect bad $HASH4 && + git bisect next +' + +test_expect_success 'bisect does not start with only one good' ' + git bisect reset && + git bisect start && + git bisect good $HASH1 || return 1 + + if git bisect next + then + echo Oops, should have failed. + false + else + : + fi +' + +test_expect_success 'bisect start with one bad and good' ' + git bisect reset && + git bisect start && + git bisect good $HASH1 && + git bisect bad $HASH4 && + git bisect next +' + +# We want to automatically find the commit that +# introduced "Another" into hello. +test_expect_success \ + '"git bisect run" simple case' \ + 'echo "#"\!"/bin/sh" > test_script.sh && + echo "grep Another hello > /dev/null" >> test_script.sh && + echo "test \$? -ne 0" >> test_script.sh && + chmod +x test_script.sh && + git bisect start && + git bisect good $HASH1 && + git bisect bad $HASH4 && + git bisect run ./test_script.sh > my_bisect_log.txt && + grep "$HASH3 is first bad commit" my_bisect_log.txt && + git bisect reset' + +# We want to automatically find the commit that +# introduced "Ciao" into hello. +test_expect_success \ + '"git bisect run" with more complex "git bisect start"' \ + 'echo "#"\!"/bin/sh" > test_script.sh && + echo "grep Ciao hello > /dev/null" >> test_script.sh && + echo "test \$? -ne 0" >> test_script.sh && + chmod +x test_script.sh && + git bisect start $HASH4 $HASH1 && + git bisect run ./test_script.sh > my_bisect_log.txt && + grep "$HASH4 is first bad commit" my_bisect_log.txt && + git bisect reset' + +# +# +test_done + diff --git a/t/t6030-bisect-run.sh b/t/t6030-bisect-run.sh deleted file mode 100755 index de3123522..000000000 --- a/t/t6030-bisect-run.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007 Christian Couder -# -test_description='Tests git-bisect functionality' - -exec > $_file || return $? - MSG="Add <$_line> into <$_file>." - else - echo "$_line" > $_file || return $? - git add $_file || return $? - MSG="Create file <$_file> with <$_line> inside." - fi - - git-commit -m "$MSG" $_file -} - -HASH1= -HASH3= -HASH4= - -test_expect_success \ - 'set up basic repo with 1 file (hello) and 4 commits' \ - 'add_line_into_file "1: Hello World" hello && - add_line_into_file "2: A new day for git" hello && - add_line_into_file "3: Another new day for git" hello && - add_line_into_file "4: Ciao for now" hello && - HASH1=$(git rev-list HEAD | tail -1) && - HASH3=$(git rev-list HEAD | head -2 | tail -1) && - HASH4=$(git rev-list HEAD | head -1)' - -test_expect_success 'bisect starts with only one bad' ' - git bisect reset && - git bisect start && - git bisect bad $HASH4 && - git bisect next -' - -test_expect_success 'bisect starts with only one good' ' - git bisect reset && - git bisect start && - git bisect good $HASH1 || return 1 - - if git bisect next - then - echo Oops, should have failed. - false - else - : - fi -' - -test_expect_success 'bisect start with one bad and good' ' - git bisect reset && - git bisect start && - git bisect good $HASH1 && - git bisect bad $HASH4 && - git bisect next -' - -# We want to automatically find the commit that -# introduced "Another" into hello. -test_expect_success \ - '"git bisect run" simple case' \ - 'echo "#"\!"/bin/sh" > test_script.sh && - echo "grep Another hello > /dev/null" >> test_script.sh && - echo "test \$? -ne 0" >> test_script.sh && - chmod +x test_script.sh && - git bisect start && - git bisect good $HASH1 && - git bisect bad $HASH4 && - git bisect run ./test_script.sh > my_bisect_log.txt && - grep "$HASH3 is first bad commit" my_bisect_log.txt && - git bisect reset' - -# We want to automatically find the commit that -# introduced "Ciao" into hello. -test_expect_success \ - '"git bisect run" with more complex "git bisect start"' \ - 'echo "#"\!"/bin/sh" > test_script.sh && - echo "grep Ciao hello > /dev/null" >> test_script.sh && - echo "test \$? -ne 0" >> test_script.sh && - chmod +x test_script.sh && - git bisect start $HASH4 $HASH1 && - git bisect run ./test_script.sh > my_bisect_log.txt && - grep "$HASH4 is first bad commit" my_bisect_log.txt && - git bisect reset' - -# -# -test_done -