From: Nguyễn Thái Ngọc Duy Date: Thu, 06 Dec 2007 13:48:17 GMT Subject: [PATCH] Add option --path to allow to run tests with real systems. You must install git before running this test. Message-ID: <20071206134817.GA8523@laptop> In-Reply-To: <7v3auhq6mv.fsf@gitster.siamese.dyndns.org> Signed-off-by: Nguyễn Thái Ngọc Duy --- On Thu, Dec 06, 2007 at 10:15:05AM +0700, Nguyen Thai Ngoc Duy wrote: > On Dec 6, 2007 2:32 AM, Junio C Hamano wrote: > > This is wrong, isn't it? $path may point at the freshly built but not > > installed git executable, but it reports --exec-path the location that > > git-foo and friends are to be _eventually_ installed, not the location > > they are sitting after built, being tested, waiting to be installed. > > > Yes, forgot to mention you must do "make install" first :) > Perhaps a check to remind people to 'make install' like this? t/lib-git-svn.sh | 2 +- t/t0000-basic.sh | 6 +++--- t/t0040-parse-options.sh | 16 ++++++++-------- t/t4200-rerere.sh | 8 ++++---- t/t5301-sliding-window.sh | 2 +- t/t5302-pack-index.sh | 4 ++-- t/test-lib.sh | 19 +++++++++++++++---- 7 files changed, 34 insertions(+), 23 deletions(-) diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh index 8d4a447..fd60ebc 100644 --- a/t/lib-git-svn.sh +++ b/t/lib-git-svn.sh @@ -46,7 +46,7 @@ rawsvnrepo="$svnrepo" svnrepo="file://$svnrepo" poke() { - test-chmtime +1 "$1" + $GIT_TEST_PATH/test-chmtime +1 "$1" } SVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/lib/apache2/modules'} diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 4e49d59..f809163 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -289,12 +289,12 @@ test_expect_success 'absolute path works as expected' ' mkdir third && dir="$(cd .git; pwd -P)" && dir2=third/../second/other/.git && - test "$dir" = "$(test-absolute-path $dir2)" && + test "$dir" = "$($GIT_TEST_PATH/test-absolute-path $dir2)" && file="$dir"/index && - test "$file" = "$(test-absolute-path $dir2/index)" && + test "$file" = "$($GIT_TEST_PATH/test-absolute-path $dir2/index)" && ln -s ../first/file .git/syml && sym="$(cd first; pwd -P)"/file && - test "$sym" = "$(test-absolute-path $dir2/syml)" + test "$sym" = "$($GIT_TEST_PATH/test-absolute-path $dir2/syml)" ' test_done diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index 462fdf2..ca1cc9f 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -23,7 +23,7 @@ string options EOF test_expect_success 'test help' ' - ! test-parse-options -h > output 2> output.err && + ! $GIT_TEST_PATH/test-parse-options -h > output 2> output.err && test ! -s output && git diff expect.err output.err ' @@ -35,7 +35,7 @@ string: 123 EOF test_expect_success 'short options' ' - test-parse-options -s123 -b -i 1729 -b > output 2> output.err && + $GIT_TEST_PATH/test-parse-options -s123 -b -i 1729 -b > output 2> output.err && git diff expect output && test ! -s output.err ' @@ -46,7 +46,7 @@ string: 321 EOF test_expect_success 'long options' ' - test-parse-options --boolean --integer 1729 --boolean --string2=321 \ + $GIT_TEST_PATH/test-parse-options --boolean --integer 1729 --boolean --string2=321 \ > output 2> output.err && test ! -s output.err && git diff expect output @@ -62,7 +62,7 @@ arg 02: --boolean EOF test_expect_success 'intermingled arguments' ' - test-parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \ + $GIT_TEST_PATH/test-parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \ > output 2> output.err && test ! -s output.err && git diff expect output @@ -75,19 +75,19 @@ string: (not set) EOF test_expect_success 'unambiguously abbreviated option' ' - test-parse-options --int 2 --boolean --no-bo > output 2> output.err && + $GIT_TEST_PATH/test-parse-options --int 2 --boolean --no-bo > output 2> output.err && test ! -s output.err && git diff expect output ' test_expect_success 'unambiguously abbreviated option with "="' ' - test-parse-options --int=2 > output 2> output.err && + $GIT_TEST_PATH/test-parse-options --int=2 > output 2> output.err && test ! -s output.err && git diff expect output ' test_expect_failure 'ambiguously abbreviated option' ' - test-parse-options --strin 123; + $GIT_TEST_PATH/test-parse-options --strin 123; test $? != 129 ' @@ -98,7 +98,7 @@ string: 123 EOF test_expect_success 'non ambiguous option (after two options it abbreviates)' ' - test-parse-options --st 123 > output 2> output.err && + $GIT_TEST_PATH/test-parse-options --st 123 > output 2> output.err && test ! -s output.err && git diff expect output ' diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index cfcdb69..ddbae1d 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -149,16 +149,16 @@ just_over_15_days_ago=$((-1-15*86400)) almost_60_days_ago=$((60-60*86400)) just_over_60_days_ago=$((-1-60*86400)) -test-chmtime =$almost_60_days_ago $rr/preimage -test-chmtime =$almost_15_days_ago $rr2/preimage +$GIT_TEST_PATH/test-chmtime =$almost_60_days_ago $rr/preimage +$GIT_TEST_PATH/test-chmtime =$almost_15_days_ago $rr2/preimage test_expect_success 'garbage collection (part1)' 'git rerere gc' test_expect_success 'young records still live' \ "test -f $rr/preimage && test -f $rr2/preimage" -test-chmtime =$just_over_60_days_ago $rr/preimage -test-chmtime =$just_over_15_days_ago $rr2/preimage +$GIT_TEST_PATH/test-chmtime =$just_over_60_days_ago $rr/preimage +$GIT_TEST_PATH/test-chmtime =$just_over_15_days_ago $rr2/preimage test_expect_success 'garbage collection (part2)' 'git rerere gc' diff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh index 073ac0c..8327051 100755 --- a/t/t5301-sliding-window.sh +++ b/t/t5301-sliding-window.sh @@ -12,7 +12,7 @@ test_expect_success \ for i in a b c do echo $i >$i && - test-genrandom "$i" 32768 >>$i && + $GIT_TEST_PATH/test-genrandom "$i" 32768 >>$i && git update-index --add $i || return 1 done && echo d >d && cat c >>d && git update-index --add d && diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh index 2a2878b..0ae9cd8 100755 --- a/t/t5302-pack-index.sh +++ b/t/t5302-pack-index.sh @@ -15,11 +15,11 @@ test_expect_success \ do i=`printf '%03i' $i` echo $i >file_$i && - test-genrandom "$i" 8192 >>file_$i && + $GIT_TEST_PATH/test-genrandom "$i" 8192 >>file_$i && git update-index --add file_$i && i=`expr $i + 1` || return 1 done && - { echo 101 && test-genrandom 100 8192; } >file_101 && + { echo 101 && $GIT_TEST_PATH/test-genrandom 100 8192; } >file_101 && git update-index --add file_101 && tree=`git write-tree` && commit=`git commit-tree $tree &2 'You need to build test-chmtime:' echo >&2 'Run "make test-chmtime" in the source (toplevel) directory' exit 1 -- 1.5.3.6.2040.gfc2f-dirty