{"thread":{"id":"18303","subject":"[PATCH 0/2] Allow running the test suite against installed git","startedAt":"2009-03-13T15:45:14Z","lastAt":"2009-03-16T17:03:12Z","messageCount":7,"participants":["Michael J Gruber","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"107958","messageId":"1236959116-3334-1-git-send-email-git@drmicha.warpmail.net","threadId":"18303","inReplyTo":null,"subject":"[PATCH 0/2] Allow running the test suite against installed git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-13T15:45:14Z","receivedAt":"2009-03-13T15:45:14Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Part 1 corrects only an inconsistency which does not matter as long as\nyou run tests against git compiled in a checkout only: There,\n$GIT_EXEC_PATH contains git, in general it does not.\n\nPart 2 allows running the test suite against a git installed anywhere in\nthe file system. This has at least 2 use cases:\n- Test an installed distro package after the installation.\n- Run easily current tests against older versions, or vice versa, if you\n  have those versions installed somewhere.\n\nNote that one still needs git compiled in git.git for test helpers etc.,\nand also because I did not adjust the paths to templates and such. I did\nnot really feel a need for that.\n\nAlso, t0000 there is still one explicit use of \"../git\" which is fine\nbecause it simply tests for the presence of a built, which we need\nanyways.\n\nMichael J Gruber (2):\n  test-lib.sh: Test for presence of git-init in the right path.\n  test-lib.sh: Allow running the test suite against installed git\n\n t/test-lib.sh |   12 +++++++++---\n 1 files changed, 9 insertions(+), 3 deletions(-)\n"},{"id":"107959","messageId":"1236959116-3334-2-git-send-email-git@drmicha.warpmail.net","threadId":"18303","inReplyTo":"1236959116-3334-1-git-send-email-git@drmicha.warpmail.net","subject":"[PATCH 1/2] test-lib.sh: Test for presence of git-init in the right path.","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-13T15:45:15Z","receivedAt":"2009-03-13T15:45:15Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"It just happens so that when GIT_EXEC_PATH points to a compiled checkout\nof git.git it contains \"git\". Since this is not true in general make\ntest-lib check for \"git-init\" which is always in GIT_EXEC_PATH.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n t/test-lib.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7a847ec..b9da86e 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -454,7 +454,7 @@ test_create_repo () {\n \trepo=\"$1\"\n \tmkdir -p \"$repo\"\n \tcd \"$repo\" || error \"Cannot setup test environment\"\n-\t\"$GIT_EXEC_PATH/git\" init \"--template=$owd/../templates/blt/\" >&3 2>&4 ||\n+\t\"$GIT_EXEC_PATH/git-init\" \"--template=$owd/../templates/blt/\" >&3 2>&4 ||\n \terror \"cannot run git init -- have you built things yet?\"\n \tmv .git/hooks .git/hooks-disabled\n \tcd \"$owd\"\n-- \n1.6.2.149.g6462\n"},{"id":"107960","messageId":"1236959116-3334-3-git-send-email-git@drmicha.warpmail.net","threadId":"18303","inReplyTo":"1236959116-3334-2-git-send-email-git@drmicha.warpmail.net","subject":"[PATCH 2/2] test-lib.sh: Allow running the test suite against installed git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-13T15:45:16Z","receivedAt":"2009-03-13T15:45:16Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Introduce variables externalpath and externalexecpath such that the test\nsuite can be run against a git which is installed at $externalpath with\nsubcommands at $externalexecpath. externalpath defaults to the git.git\ncheckout, externalexecpath defaults to $externalpath. Run the suite as\n\nexternalpath=somepath externalexecpath=someotherpath make test\n\nbut note that this requires and uses parts of a compiled git in the\ngit.git checkout: test helpers, templates and perl libraries are taken\nfrom there.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n t/test-lib.sh |   10 ++++++++--\n 1 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b9da86e..f6c467f 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -514,8 +514,14 @@ test_done () {\n TEST_DIRECTORY=$(pwd)\n if test -z \"$valgrind\"\n then\n-\tPATH=$TEST_DIRECTORY/..:$PATH\n-\tGIT_EXEC_PATH=$TEST_DIRECTORY/..\n+\tif test -z \"$externalpath\"\n+\tthen\n+\t\tPATH=$TEST_DIRECTORY/..:$PATH\n+\t\tGIT_EXEC_PATH=$TEST_DIRECTORY/..\n+\telse\n+\t\tPATH=$externalpath:$TEST_DIRECTORY/..:$PATH\n+\t\tGIT_EXEC_PATH=${externalexecpath:-$externalpath}\n+\tfi\n else\n \tmake_symlink () {\n \t\ttest -h \"$2\" &&\n-- \n1.6.2.149.g6462\n"},{"id":"108018","messageId":"7v3adfc0n4.fsf@gitster.siamese.dyndns.org","threadId":"18303","inReplyTo":"1236959116-3334-3-git-send-email-git@drmicha.warpmail.net","subject":"Re: [PATCH 2/2] test-lib.sh: Allow running the test suite against installed git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-14T20:25:35Z","receivedAt":"2009-03-14T20:25:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Introduce variables externalpath and externalexecpath such that the test\n> suite can be run against a git which is installed at $externalpath with\n> subcommands at $externalexecpath. externalpath defaults to the git.git\n> checkout, externalexecpath defaults to $externalpath. Run the suite as\n>\n> externalpath=somepath externalexecpath=someotherpath make test\n>\n> but note that this requires and uses parts of a compiled git in the\n> git.git checkout: test helpers, templates and perl libraries are taken\n> from there.\n\nWhile I like the end result this series tries to achieve, may I suggest a\nfew things?\n\n - This is like GIT_SKIP_TESTS and GIT_TEST_HTTPD in that extra\n   environments affect how the tests are run.  It would be much easier to\n   use if the new environment variables are named similarly, prefixed with\n   GIT_, in all caps, and with underscores between words.\n\n - When externalpath is given but not externalexecpath, you can deduce the\n   latter from the former by running \"$externalpath/git --exec-path\",\n   which makes running the tests against an installed git even easier.\n   For example, I keep many git installations under $HOME/git-snap-vX.Y.Z,\n   and it would be great if your patch allowed me to say something like:\n\n    $ GIT_TEST_INSTALLED=$HOME/git-snap-v1.4.4.4/bin/git make test\n"},{"id":"108103","messageId":"1237222992-19421-1-git-send-email-git@drmicha.warpmail.net","threadId":"18303","inReplyTo":"7v3adfc0n4.fsf@gitster.siamese.dyndns.org","subject":"[PATCHv2 0/2] Allow running the test suite against installed git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-16T17:03:10Z","receivedAt":"2009-03-16T17:03:10Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Part 1 corrects only an inconsistency which does not matter as long as\nyou run tests against git compiled in a checkout only: There,\n$GIT_EXEC_PATH contains git, in general it does not.\n\nPart 2 allows running the test suite against a git installed anywhere in\nthe file system. This has at least 2 use cases:\n- Test an installed distro package after the installation.\n- Run easily current tests against older versions, or vice versa, if you\n  have those versions installed somewhere.\n\nNote that one still needs git compiled in git.git for test helpers etc.,\nand also because I did not adjust the paths to templates and such. I did\nnot really feel a need for that.\n\nAlso, in t0000 there is still one explicit use of \"../git\" which is fine\nbecause it simply tests for the presence of a build, which we need\nanyways.\n\nv2 incorporates feed-back by JCH: variables are named GIT_TEST_INSTALLED\nand GIT_TEST_EXEC_PATH now, the latter defaulting to the output of\n$GIT_TEST_INSTALLED/git --exec-path.\n\nAlso, we exit gracefully in case we cannot run $GIT_TEST_INSTALLED/git.\n\nMichael J Gruber (2):\n  test-lib.sh: Test for presence of git-init in the right path.\n  test-lib.sh: Allow running the test suite against installed git\n\n t/test-lib.sh |   14 +++++++++++---\n 1 files changed, 11 insertions(+), 3 deletions(-)\n"},{"id":"108102","messageId":"1237222992-19421-2-git-send-email-git@drmicha.warpmail.net","threadId":"18303","inReplyTo":"7v3adfc0n4.fsf@gitster.siamese.dyndns.org","subject":"[PATCHv2 1/2] test-lib.sh: Test for presence of git-init in the right path.","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-16T17:03:11Z","receivedAt":"2009-03-16T17:03:11Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"It just happens so that when GIT_EXEC_PATH points to a compiled checkout\nof git.git it contains \"git\". Since this is not true in general make\ntest-lib check for \"git-init\" which is always in GIT_EXEC_PATH.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n t/test-lib.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7a847ec..b9da86e 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -454,7 +454,7 @@ test_create_repo () {\n \trepo=\"$1\"\n \tmkdir -p \"$repo\"\n \tcd \"$repo\" || error \"Cannot setup test environment\"\n-\t\"$GIT_EXEC_PATH/git\" init \"--template=$owd/../templates/blt/\" >&3 2>&4 ||\n+\t\"$GIT_EXEC_PATH/git-init\" \"--template=$owd/../templates/blt/\" >&3 2>&4 ||\n \terror \"cannot run git init -- have you built things yet?\"\n \tmv .git/hooks .git/hooks-disabled\n \tcd \"$owd\"\n-- \n1.6.2.149.g6462\n"},{"id":"108101","messageId":"1237222992-19421-3-git-send-email-git@drmicha.warpmail.net","threadId":"18303","inReplyTo":"7v3adfc0n4.fsf@gitster.siamese.dyndns.org","subject":"[PATCHv2 2/2] test-lib.sh: Allow running the test suite against installed git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-16T17:03:12Z","receivedAt":"2009-03-16T17:03:12Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Introduce variables GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH such that\nthe test suite can be run against a git which is installed at\nGIT_TEST_INSTALLED with subcommands at GIT_TEST_EXEC_PATH.\nGIT_TEST_INSTALLED defaults to the git.git checkout, GIT_TEST_EXEC_PATH\ndefaults to the output of '$GIT_TEST_INSTALLED/git --exec-path'. Run the\nsuite e.g. as\n\nGIT_TEST_INSTALLED=/some/path make test\n\nbut note that this requires and uses parts of a compiled git in the\ngit.git checkout: test helpers, templates and perl libraries are taken\nfrom there.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n t/test-lib.sh |   12 ++++++++++--\n 1 files changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b9da86e..c677904 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -514,8 +514,16 @@ test_done () {\n TEST_DIRECTORY=$(pwd)\n if test -z \"$valgrind\"\n then\n-\tPATH=$TEST_DIRECTORY/..:$PATH\n-\tGIT_EXEC_PATH=$TEST_DIRECTORY/..\n+\tif test -z \"$GIT_TEST_INSTALLED\"\n+\tthen\n+\t\tPATH=$TEST_DIRECTORY/..:$PATH\n+\t\tGIT_EXEC_PATH=$TEST_DIRECTORY/..\n+\telse\n+\t\tGIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path)  ||\n+\t\terror \"Cannot run git from $GIT_TEST_INSTALLED.\"\n+\t\tPATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH\n+\t\tGIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}\n+\tfi\n else\n \tmake_symlink () {\n \t\ttest -h \"$2\" &&\n-- \n1.6.2.149.g6462\n"}]}