summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
AgeCommit message (Collapse)AuthorFilesLines
2013-04-14t/test-lib.sh: drop "$test" variableLibravatar Jeff King1-5/+5
The $test variable is used as an interim buffer for constructing $TRASH_DIRECTORY, and is almost compatible with it (the exception being that $test has not been converted to an absolute path). Let's get rid of it entirely so that later code does not accidentally use it, thinking the two are interchangeable. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14t/test-lib.sh: fix TRASH_DIRECTORY handlingLibravatar John Keeping1-4/+4
After the location of $TRASH_DIRECTORY is adjusted by $TEST_OUTPUT_DIRECTORY, we go on to use the $test variable to make the trash directory and cd into it. This means that when $TEST_OUTPUT_DIRECTORY is not "." and an absolute --root has not been specified, we do not remove the trash directory once the tests are complete (remove_trash is set to $TRASH_DIRECTORY). Fix this by always referring to the trash directory as $TRASH_DIRECTORY. Signed-off-by: John Keeping <john@keeping.me.uk> Acked-by: Jeff King <peff@peff.net> Acked-by: Thomas Rast <trast@inf.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11t: make PIPE a standard test prerequisiteLibravatar Adam Spiers1-0/+5
The 'PIPE' test prerequisite was already defined identically by t9010 and t9300, therefore it makes sense to make it a predefined prerequisite. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03Merge branch 'jk/empty-archive' into maintLibravatar Junio C Hamano1-0/+6
"git archive" reports a failure when asked to create an archive out of an empty tree. It would be more intuitive to give an empty archive back in such a case. * jk/empty-archive: archive: handle commits with an empty tree test-lib: factor out $GIT_UNZIP setup
2013-03-10test-lib: factor out $GIT_UNZIP setupLibravatar Jeff King1-0/+6
We set up the $GIT_UNZIP variable and lazy prereq in multiple places (and the next patch is about to add another one). Let's factor it out to avoid repeating ourselves. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-07Merge branch 'nd/fix-perf-parameters-in-tests' into maintLibravatar Junio C Hamano1-1/+1
* nd/fix-perf-parameters-in-tests: test-lib.sh: unfilter GIT_PERF_*
2013-01-26git p4 test: translate windows paths for cygwinLibravatar Pete Wyckoff1-0/+3
Native windows binaries do not understand posix-like path mapping offered by cygwin. Convert paths to native using "cygpath --windows" before presenting them to p4d. This is done using the AltRoots mechanism of p4. Both the posix and windows forms are put in the client specification, allowing p4 to find its location by native path even though the environment reports a different PWD. Shell operations in tests will use the normal form of $cli, which will look like a posix path in cygwin, while p4 will use AltRoots to match against the windows form of the working directory. This mechanism also handles the symlink issue that was fixed in 23bd0c9 (git p4 test: use real_path to resolve p4 client symlinks, 2012-06-27). Now that every p4 client view has an AltRoots with the real_path in it, explicitly calculating the real_path elsewhere is not necessary. Thanks-to: Sebastian Schuberth <sschuberth@gmail.com> Thanks-to: Johannes Sixt <j6t@kdbg.org> fixup! git p4 test: translate windows paths for cygwin Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-20Merge branch 'rs/zip-tests' into maintLibravatar Junio C Hamano1-0/+2
* rs/zip-tests: t5003: check if unzip supports symlinks t5000, t5003: move ZIP tests into their own script t0024, t5000: use test_lazy_prereq for UNZIP t0024, t5000: clear variable UNZIP, use GIT_UNZIP instead
2013-01-18Merge branch 'nd/fix-perf-parameters-in-tests'Libravatar Junio C Hamano1-1/+1
Allow GIT_PERF_* environment variables to be passed through the test framework. * nd/fix-perf-parameters-in-tests: test-lib.sh: unfilter GIT_PERF_*
2013-01-15test-lib.sh: unfilter GIT_PERF_*Libravatar Nguyễn Thái Ngọc Duy1-1/+1
These variables are user parameters to control how to run the perf tests. Allow users to do so. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-11Merge branch 'rs/zip-tests'Libravatar Junio C Hamano1-0/+2
Update zip tests to skip some that cannot be handled on platform unzip. * rs/zip-tests: t5003: check if unzip supports symlinks t5000, t5003: move ZIP tests into their own script t0024, t5000: use test_lazy_prereq for UNZIP t0024, t5000: clear variable UNZIP, use GIT_UNZIP instead
2013-01-06t0024, t5000: clear variable UNZIP, use GIT_UNZIP insteadLibravatar René Scharfe1-0/+2
InfoZIP's unzip takes default parameters from the environment variable UNZIP. Unset it in the test library and use GIT_UNZIP for specifying alternate versions of the unzip command instead. t0024 wasn't even using variable for the actual extraction. t5000 was, but when setting it to InfoZIP's unzip it would try to extract from itself (because it treats the contents of $UNZIP as parameters), which failed of course. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03Merge branch 'as/test-tweaks'Libravatar Junio C Hamano1-11/+18
Output from the tests is coloured using "green is okay, yellow is questionable, red is bad and blue is informative" scheme. * as/test-tweaks: tests: paint unexpectedly fixed known breakages in bold red tests: test the test framework more thoroughly tests: refactor mechanics of testing in a sub test-lib tests: change info messages from yellow/brown to cyan tests: paint skipped tests in blue tests: paint known breakages in yellow tests: test number comes first in 'not ok $count - $message'
2012-12-20tests: paint unexpectedly fixed known breakages in bold redLibravatar Adam Spiers1-4/+9
Change color of unexpectedly fixed known breakages to bold red. An unexpectedly passing test indicates that the test code is somehow broken or out of sync with the code it is testing. Either way this is an error which is potentially as bad as a failing test, and as such is no longer portrayed as a pass in the output. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-20tests: change info messages from yellow/brown to cyanLibravatar Adam Spiers1-3/+3
Now that we've adopted a "traffic lights" coloring scheme, yellow is used for warning messages, so we need to re-color info messages to something less alarmist. Blue is a universal color for informational messages; however we are using that for skipped tests in order to align with the color schemes of other test suites. Therefore we use cyan which is also blue-ish, but visually distinct from blue. This was suggested on the list a while ago and no-one raised any objections: http://thread.gmane.org/gmane.comp.version-control.git/205675/focus=205966 An earlier iteration of this patch used bold cyan, but the point of this change is to make them less alarming; let's drop the boldness. Also paint the message to report skipping the whole thing via GIT_SKIP_TESTS mechanism in the same color as the "info" color that is used on the final summary line for the entire script. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-20tests: paint skipped tests in blueLibravatar Adam Spiers1-1/+1
Skipped tests indicate incomplete test coverage. Whilst this is not a test failure or other error, it's still not a complete success. Other testsuite related software like automake, autotest and prove seem to use blue for skipped tests, so let's follow suit. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-20tests: paint known breakages in yellowLibravatar Adam Spiers1-2/+4
Yellow seems a more appropriate color than bold green when considering the universal traffic lights coloring scheme, where green conveys the impression that everything's OK, and amber that something's not quite right. Likewise, change the color of the summarized total number of known breakages from bold red to the same yellow to be less alarmist and more consistent with the above. An earlier version of this patch used bold yellow but because these are all long-known failures, reminding them to developers in bold over and over does not help encouraging them to take a look at them very much. This iteration paints them in plain yellow instead to make them less distracting. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-16tests: test number comes first in 'not ok $count - $message'Libravatar Adam Spiers1-1/+1
The old output to say "not ok - 1 messsage" was working by accident only because the test numbers are optional in TAP. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-29Merge branch 'fc/remote-hg'Libravatar Junio C Hamano1-1/+2
New remote helper for hg. * fc/remote-hg: (22 commits) remote-hg: fix for older versions of python remote-hg: fix for files with spaces remote-hg: avoid bad refs remote-hg: try the 'tip' if no checkout present remote-hg: fix compatibility with older versions of hg remote-hg: add missing config for basic tests remote-hg: the author email can be null remote-hg: add option to not track branches remote-hg: add extra author test remote-hg: add tests to compare with hg-git remote-hg: add bidirectional tests test-lib: avoid full path to store test results remote-hg: add basic tests remote-hg: fake bookmark when there's none remote-hg: add compat for hg-git author fixes remote-hg: add support for hg-git compat mode remote-hg: match hg merge behavior remote-hg: make sure the encoding is correct remote-hg: add support to push URLs remote-hg: add support for remote pushing ...
2012-11-18Merge branch 'jc/test-say-color-avoid-echo-escape' into maintLibravatar Junio C Hamano1-1/+1
The "say" function in the test scaffolding incorrectly allowed "echo" to interpret "\a" as if it were a C-string asking for a BEL output. * jc/test-say-color-avoid-echo-escape: test-lib: Fix say_color () not to interpret \a\b\c in the message
2012-11-15t7502: factor out autoident prerequisiteLibravatar Jeff King1-0/+6
t7502 checks the behavior of commit when we can and cannot determine a valid committer ident. Let's move that into test-lib as a lazy prerequisite so other scripts can use it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-04test-lib: avoid full path to store test resultsLibravatar Felipe Contreras1-1/+2
No reason to use the full path in case this is used externally. Otherwise we might get errors such as: ./test-lib.sh: line 394: /home/bob/dev/git/t/test-results//home/bob/dev/git/contrib/remote-hg/test-2894.counts: No such file or directory Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-10-25Merge branch 'jc/test-say-color-avoid-echo-escape'Libravatar Jeff King1-1/+1
Recent nd/wildmatch series was the first to reveal this ancient bug in the test scaffolding. * jc/test-say-color-avoid-echo-escape: test-lib: Fix say_color () not to interpret \a\b\c in the message
2012-10-11test-lib: Fix say_color () not to interpret \a\b\c in the messageLibravatar Junio C Hamano1-1/+1
When running with color disabled (e.g. under prove to produce TAP output), say_color() helper function is defined to use echo to show the message. With a message that ends with "\c", echo is allowed to interpret it as "Do not end the line with LF". Use printf "%s\n" to emit the message literally. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-01Merge branch 'ep/malloc-check-perturb'Libravatar Junio C Hamano1-1/+1
Fixes a brown-paper bag bug. * ep/malloc-check-perturb: MALLOC_CHECK: enable it, unless disabled explicitly
2012-09-29Merge branch 'rr/test-use-shell-path-not-shell'Libravatar Junio C Hamano1-16/+16
Fixes a brown-paper bag bug. * rr/test-use-shell-path-not-shell: test-lib: use $SHELL_PATH, not $SHELL
2012-09-26MALLOC_CHECK: enable it, unless disabled explicitlyLibravatar René Scharfe1-1/+1
The malloc checks in tests are currently disabled. Actually evaluate the variable for turning them off and enable them if it's unset. Also use this opportunity to give it the more descriptive and consistent name TEST_NO_MALLOC_CHECK. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-25Merge branch 'rr/test-make-sure-we-have-git'Libravatar Junio C Hamano1-0/+9
Only the first test t0000 in the test suite made sure we have built Git to be tested; move the check to test-lib so that it applies to all tests equally. * rr/test-make-sure-we-have-git: t/test-lib: make sure Git has already been built
2012-09-25test-lib: use $SHELL_PATH, not $SHELLLibravatar Ramkumar Ramachandra1-16/+16
The codepath for handling "--tee" ends up relaunching the test script under a shell, and that one has to be a Bourne. But we incorrectly used $SHELL, which could be a non-Bourne (e.g. zsh or csh); we have the Makefile variable $SHELL_PATH for exactly that, so use it instead. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-18t/test-lib: make sure Git has already been builtLibravatar Ramkumar Ramachandra1-0/+9
When tests were run without building git, they stopped with: .: 54: Can't open /path/to/git/source/t/../GIT-BUILD-OPTIONS Move the check that makes sure that git has already been built from t0000 to test-lib, so that any test will do so before it runs. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-17MALLOC_CHECK: various clean-upsLibravatar Junio C Hamano1-6/+20
The most important in this change is to avoid affecting anything when test-lib is used from perf-lib. It also limits the effect of the MALLOC_CHECK only to what is run inside the actual test, and uses a fixed MALLOC_PERTURB_ in order to avoid hurting repeatability of the tests. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-14Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for ↵Libravatar Elia Pinto1-0/+9
detecting heap corruption Recent versions of Linux libc (later than 5.4.23) and glibc (2.x) include a malloc() implementation which is tunable via environment variables. When MALLOC_CHECK_ is set, a special (less efficient) implementation is used which is designed to be tolerant against simple errors, such as double calls of free() with the same argument, or overruns of a single byte (off-by-one bugs). When MALLOC_CHECK_ is set to 3, a diagnostic message is printed on stderr and the program is aborted. Setting the MALLOC_PERTURB_ environment variable causes the malloc functions in libc to return memory which has been wiped and clear memory when it is returned. Of course this does not affect calloc which always does clear the memory. The reason for this exercise is, of course, to find code which uses memory returned by malloc without initializing it and code which uses code after it is freed. valgrind can do this but it's costly to run. The MALLOC_PERTURB_ exchanges the ability to detect problems in 100% of the cases with speed. The byte value used to initialize values returned by malloc is the byte value of the environment value. The value used to clear memory is the bitwise inverse. Setting MALLOC_PERTURB_ to zero disables the feature. This technique can find hard to detect bugs. It is therefore suggested to always use this flag (at least temporarily) when testing out code or a new distribution. But the test suite can use also valgrind(memcheck) via 'make valgrind' or 'make GIT_TEST_OPTS="--valgrind"'. Memcheck wraps client calls to malloc(), and puts a "red zone" on each end of each block in order to detect access overruns. Memcheck already detects double free() (up to the limit of the buffer which remembers pending free()). Thus memcheck subsumes all the documented coverage of MALLOC_CHECK_. If MALLOC_CHECK_ is set non-zero when running memcheck, then the overruns that might be detected by MALLOC_CHECK_ would be overruns on the wrapped blocks which include the red zones. Thus MALLOC_CHECK_ would be checking memcheck, and not the client. This is not useful, and actually is wasteful. The only possible [documented] advantage of using MALLOC_CHECK_ and memcheck together, would be if MALLOC_CHECK_ detected duplicate free() in more cases than memcheck because memcheck's buffer is too small. Therefore we don't use MALLOC_CHECK_ and valgrind(memcheck) at the same time. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-14Merge branch 'rj/tap-fix'Libravatar Junio C Hamano1-23/+46
* rj/tap-fix: test-lib.sh: Suppress the "passed all ..." message if no tests run test-lib.sh: Add check for invalid use of 'skip_all' facility test-lib.sh: Fix some shell coding style violations t4016-*.sh: Skip all tests rather than each test t3902-*.sh: Skip all tests rather than each test t3300-*.sh: Fix a TAP parse error
2012-09-02test-lib.sh: Suppress the "passed all ..." message if no tests runLibravatar Ramsay Jones1-1/+4
If a test script issues a test_done without executing any tests, for example when using the 'skip_all' facility, the output looks something like this: $ ./t9159-git-svn-no-parent-mergeinfo.sh # passed all 0 test(s) 1..0 # SKIP skipping git svn tests, svn not found $ The "passed all 0 test(s)" comment line, while correct, looks a little strange. Add a check to suppress this message if no tests have actually been run. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-02test-lib.sh: Add check for invalid use of 'skip_all' facilityLibravatar Ramsay Jones1-0/+4
The 'skip_all' facility cannot be used after one or more tests have been executed using (for example) 'test_expect_success'. To do so results in invalid TAP output, which leads to 'prove' complaining of "Parse errors: No plan found in TAP output". Add a check for such invalid usage and abort the test with an error message to alert the test author. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-02test-lib.sh: Fix some shell coding style violationsLibravatar Ramsay Jones1-22/+38
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-27test-lib: provide UTF8 behaviour as a prerequisiteLibravatar Michael J Gruber1-0/+13
UTF8 behaviour of the filesystem (conversion from nfd to nfc) plays a role in several tests and is tested in several tests. Therefore, move the test from t0050 into the test lib and use the prerequisite in t0050. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-27test-lib: provide case insensitivity as a prerequisiteLibravatar Michael J Gruber1-0/+6
Case insensitivity plays a role in several tests and is tested in several tests. Therefore, move the test from t003 into the test lib and use the prerequisite in t0003. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-27test: allow prerequisite to be evaluated lazilyLibravatar Junio C Hamano1-3/+4
The test prerequisite mechanism is a useful way to allow some tests in a test script to be skipped in environments that do not support certain features (e.g. it is pointless to attempt checking how well symbolic links are handled by Git on filesystems that do not support them). It is OK for commonly used prerequisites to be always tested during start-up of a test script by having a codeblock that tests a feature and calls test_set_prereq, but for an uncommon feature, forcing 90% of scripts to pay the same probing overhead for prerequisite they do not care about is wasteful. Introduce a mechanism to probe the prerequiste lazily. Changes are: - test_lazy_prereq () function, which takes the name of the prerequisite it probes and the script to probe for it, is added. This only registers the name of the prerequiste that can be lazily probed and the script to eval (without running). - test_have_prereq() function (which is used by test_expect_success and also can be called directly by test scripts) learns to look at the list of prerequisites that can be lazily probed, and the prerequisites that have already been probed that way. When asked for a prerequiste that can be but haven't been probed, the script registered with an earlier call to test_lazy_prereq is evaluated and the prerequisite is set. - test_run_lazy_prereq_() function is a helper to run the probe script with the same kind of sandbox as regular tests, helped by Jeff King. Update the codeblock to probe and set SYMLINKS prerequisite using the new mechanism as an example. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-25Merge branch 'jc/test-lib-source-build-options-early'Libravatar Junio C Hamano1-23/+22
Reorders t/test-lib.sh so that we dot-source GIT-BUILD-OPTIONS that records the shell and Perl the user told us to use with Git a lot early, so that test-lib.sh script itself can use "$PERL_PATH" in one of its early operations. * jc/test-lib-source-build-options-early: test-lib: reorder and include GIT-BUILD-OPTIONS a lot earlier
2012-07-25Merge branch 'mm/config-xdg'Libravatar Junio C Hamano1-0/+1
Finishing touches to the XDG support (new feature for 1.7.12) and tests. * mm/config-xdg: t1306: check that XDG_CONFIG_HOME works ignore: make sure we have an xdg path before using it attr: make sure we have an xdg path before using it test-lib.sh: unset XDG_CONFIG_HOME
2012-07-24test-lib.sh: unset XDG_CONFIG_HOMELibravatar Jeff King1-0/+1
Now that git respects XDG_CONFIG_HOME for some lookups, we must be sure to cleanse the test environment. Otherwise, the user's XDG_CONFIG_HOME could influence the test results. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-24test-lib: reorder and include GIT-BUILD-OPTIONS a lot earlierLibravatar Junio C Hamano1-23/+22
This dot-sources GIT-BUILD-OPTIONS a lot earlier in test-lib.sh so that its use of "perl" can use "$PERL_PATH" to choose the version of Perl the user told us is suitable for our use. This is iffy; I didn't check it very carefully, and I would not be surprised if there are subtle breakages. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-24t/test-lib.sh: export PERL_PATH for use in scriptsLibravatar Junio C Hamano1-0/+2
Most notably, t4031 creates a small shell script that invokes perl and we want to use "$PERL_PATH" to name the version of Perl suitable for our use, read from GIT-BUILD-OPTS. The test would fail when it is directly run in t/ directory from the shell or "make" is run in t/ directory. This problem was hidden from "make test" run in the top-level directory, because its Makefile exports PERL_PATH. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-02Merge branch 'zj/mksh-columns-breakage'Libravatar Junio C Hamano1-0/+1
A broken shell may not let us set an environment value to an arbitrary value, interfering with some of the tests. Introduce a test prerequisite so that we can skip some tests on such a platform. By Zbigniew Jędrzejewski-Szmek * zj/mksh-columns-breakage: test-lib: skip test with COLUMNS=1 under mksh
2012-04-27test-lib: skip test with COLUMNS=1 under mkshLibravatar Zbigniew Jędrzejewski-Szmek1-0/+1
mksh does not allow $COLUMNS to be set below 12. mksh(1) says that $COLUMNS is "always set, defaults to 80, unless the value as reported by stty(1) is non-zero and sane enough". This applies also to setting it directly for one command: $ COLUMNS=10 python -c 'import os; print os.environ["COLUMNS"]' 98 Add a test prerequisite by checking if we can set COLUMNS=1, to allow us to skip tests that needs it. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-27tests: unset COLUMNS inherited from environmentLibravatar Zbigniew Jędrzejewski-Szmek1-1/+1
$COLUMNS must be unset to not interfere with the tests. The tests already ignore the terminal size because output is redirected to a file, but COLUMNS overrides terminal size detection and changes the test output away from the standard 80. Reported-by: Jeff King <peff@peff.net> Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04Merge branch 'maint'Libravatar Junio C Hamano1-4/+5
* maint: Update draft release notes to 1.7.9.3 for the last time http.proxy: also mention https_proxy and all_proxy t0300: work around bug in dash 0.5.6 t5512 (ls-remote): modernize style tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh
2012-03-02tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/shLibravatar Stefano Lattarini1-4/+5
If any test script is run directly with Solaris 10 /usr/xpg4/bin/sh or /bin/ksh, it fails spuriously with a message like: t0000-basic.sh[31]: unset: bad argument count This happens because those shells bail out when encountering a call to "unset" with no arguments, and such unset call could take place in 'test-lib.sh'. Fix that issue, and add a proper comment to ensure we don't regress in this respect. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-17Introduce a performance testing frameworkLibravatar Thomas Rast1-3/+23
This introduces a performance testing framework under t/perf/. It tries to be as close to the test-lib.sh infrastructure as possible, and thus should be easy to get used to for git developers. The following points were considered for the implementation: 1. You usually want to compare arbitrary revisions/build trees against each other. They may not have the performance test under consideration, or even the perf-lib.sh infrastructure. To cope with this, the 'run' script lets you specify arbitrary build dirs and revisions. It even automatically builds the revisions if it doesn't have them at hand yet. 2. Usually you would not want to run all tests. It would take too long anyway. The 'run' script lets you specify which tests to run; or you can also do it manually. There is a Makefile for discoverability and 'make clean', but it is not meant for real-world use. 3. Creating test repos from scratch in every test is extremely time-consuming, and shipping or downloading such large/weird repos is out of the question. We leave this decision to the user. Two different sizes of test repos can be configured, and the scripts just copy one or more of those (using hardlinks for the object store). By default it tries to use the build tree's git.git repository. This is fairly fast and versatile. Using a copy instead of a clone preserves many properties that the user may want to test for, such as lots of loose objects, unpacked refs, etc. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>