{"thread":{"id":"13994","subject":"[PATCH] test-lib.sh: add --long-tests option","startedAt":"2008-06-17T06:26:01Z","lastAt":"2008-06-17T06:26:01Z","messageCount":1,"participants":["Lea Wiemann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"80103","messageId":"1213683961-15183-1-git-send-email-LeWiemann@gmail.com","threadId":"13994","inReplyTo":null,"subject":"[PATCH] test-lib.sh: add --long-tests option","fromName":"Lea Wiemann","fromEmail":"lewiemann@gmail.com","sentAt":"2008-06-17T06:26:01Z","receivedAt":"2008-06-17T06:26:01Z","isPatch":true,"sender":{"key":"lewiemann@gmail.com","avatar":null},"body":"Add a --long-tests option to test-lib.sh, which enables tests to\nselectively run more exhaustive (longer running, potentially\nbrute-force) tests.  Such exhaustive tests would only be useful if one\nworks on the specific module that is being tested -- for a general \"cd\nt/; make\" to check whether everything is OK, such exhaustive tests\nshouldn't be run by default since the longer it takes to run the\ntests, the less often they are actually run.\n\nSigned-off-by: Lea Wiemann <LeWiemann@gmail.com>\n---\nRight now I'm using this in the Mechanize test for exhaustive link\nchecking on each page.  I've caught bugs with this (such as the\n\"[PATCH] gitweb: fix support for repository directories with spaces\"\nthat I just sent), so it's actually useful for development, but it's\nso slow that I wouldn't want it to be run unless the user requests it\n-- the link checking is really quite brute-force and doesn't cover\nmuch more than the actual test.  Actual breakages (regressions) are\nquite likely to be caught by the normal test.\n\nRunning the Mechanize test in long mode takes more than 1 minute on my\nsystem, vs 5 seconds in normal mode -- and that's just with a really\nshort draft of the test suite.  So running those long tests\nunconditionally would slow down \"cd t; make\" unncessarily, and we want\ntests to be fast so that people actually run them.\n\n\nIs the wording OK?  --long-tests and GIT_TEST_LONG were the best terms\nI could come up with off the top of my head.\n\n\n(ISTR that there's some large open source project that uses this\nstrategy (long vs. normal tests) quite extensively, but I can't recall\nwhich one; hints appreciated.  GCC uses it in its compatibility tests;\nits testsuite/README.compat reads,\n\n  Normally, only a small amount of compatibility tests is run.\n  Setting RUN_ALL_COMPAT_TESTS=1 in the environment before running the\n  testsuite enables running all compatibility tests, but might take\n  significantly longer than it takes without this variable.)\n\n-- Lea\n\n t/README      |    4 ++++\n t/test-lib.sh |    2 ++\n 2 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 70841a4..dc89263 100644\n--- a/t/README\n+++ b/t/README\n@@ -54,6 +54,10 @@ You can pass --verbose (or -v), --debug (or -d), and --immediate\n \tThis causes the test to immediately exit upon the first\n \tfailed test.\n \n+--long-tests::\n+\tThis causes additional long-running tests to be run (where\n+\tavailable), for more exhaustive testing.\n+\n \n Naming Tests\n ------------\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 163167c..4cd99af 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -80,6 +80,8 @@ do\n \t\tdebug=t; shift ;;\n \t-i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)\n \t\timmediate=t; shift ;;\n+\t-l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)\n+\t\texport GIT_TEST_LONG=t; shift ;;\n \t-h|--h|--he|--hel|--help)\n \t\thelp=t; shift ;;\n \t-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)\n-- \n1.5.6.rc3.7.ged9620\n"}]}