aboutsummaryrefslogtreecommitdiff
path: root/t/test-lib.sh
Commit message (Collapse)AuthorAge
* t0000: catch trivial pilot errors.Junio C Hamano2005-12-10
| | | | | | | | People seem to be getting test failure from t6021 not becuase git is faulty but because they forgot to install "merge". Check this and other trivial pilot errors in the first test. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Use GIT_EXEC_PATH explicitly for initial git-init-db in tests.Junio C Hamano2005-12-09
| | | | | | | | This is just a belts-and-suspenders check, but makes sure we have both "git" and "git-init-db" built, executable, and checking. Signed-off-by: Junio C Hamano <junkio@cox.net>
* use "git init-db" in testsAlex Riesen2005-12-09
| | | | | | | | | | | This is to catch an error where tests are run without first building what are being tested. Relying on prefixing $PATH with the build directory and expect that the PATH mechanism would find what we just built would silently run an already installed binaries from the PATH. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make sure we use compat/subprocess.py with Python 2.3 while running tests.Junio C Hamano2005-12-07
| | | | | | Otherwise the test will not succeed without installing. Signed-off-by: Junio C Hamano <junkio@cox.net>
* test-lib.sh: Add new function, test_expect_codeFredrik Kuivinen2005-12-03
| | | | | | | The test is considered OK if it exits with code $1 Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix tests with new git in CJohannes Schindelin2005-11-15
| | | | | | | GIT_EXEC_PATH *has* to be set. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Disable hooks during tests.Junio C Hamano2005-10-16
| | | | | | | | Individual tests for hooks would want to have their own tests when written. Also we should not pick up from random templates the user happens to have. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Also force LC_ALL in test scripts.Junio C Hamano2005-10-09
| | | | | | Noticed by Junichi Uekawa. Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Trapping exit in tests, using return for errors: further fixes.Pavel Roskin2005-08-11
| | | | | | | | | | | | | "return" from a test would leave the exit trap set, which could cause a spurious error message if it's the last test in the script or --immediate is used. The easiest solution would be to have a global trap that is set when test-lib.sh is sourced and unset either by test_done(), error() or by test_failure_() with --immediate. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Trapping exit in tests, using return for errorsPavel Roskin2005-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have noticed that "make test" fails without any explanations when the "merge" utility is missing. I don't think tests should be silent in case of failure. It turned out that the particular test was using "exit" to interrupt the test in case of an error. This caused the whole test script to exit. No further tests would be run even if "--immediate" wasn't specified. No error message was printed. This patch does following: All instances of "exit", "exit 1" and "(exit 1)" in tests have been replaced with "return 1". In fact, "(exit 1)" had no effect. File descriptor 5 is duplicated from file descriptor 1. This is needed to print important error messages from tests. New function test_run_() has been introduced. Any "return" in the test would merely cause that function to return without skipping calls to test_failure_() and test_ok_(). The new function also traps "exit" and treats it like a fatal error (in case somebody reintroduces "exit" in the tests). test_expect_failure() and test_expect_success() check both the result of eval and the return value of test_run_(). If the later is not 0, it's always a failure because it indicates the the test didn't complete. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Need to set PAGER in testsPavel Roskin2005-08-11
| | | | | | | | | "t5400-send-pack.sh --verbose" stops waiting for user input. It happens because "git log" uses less for output now. To prevent this, PAGER should be set to cat. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* String comparison of test is done with '=', not '=='.Junio C Hamano2005-08-11
| | | | | | Caught this during a test setting /bin/sh to (d)ash. Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Test framework: prettyprint the failed command.Junio C Hamano2005-07-22
| | | | | | | | | | The output from a failure case had the test description message and the first line of the actual test script concatenated on the same line, which was ugly. Correct the output routine a bit to make it more readable. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH 1/2] Test suite fixup.Junio C Hamano2005-05-14
| | | | | | | | | | | | | | Exposing test_expect_success and test_expect_failure turns out to be enough for the test scripts and there is no need for exposing test_ok or test_failure. This patch cleans it up and fixes the users of test_ok and test_failure. Also test scripts have acquired a new command line flag '--immediate' to cause them to exit upon the first failure. This is useful especially during the development of a new test. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>
* Try to make test output look betterPetr Baudis2005-05-14
| | | | | | NO changed to FAIL and ok was right-aligned with it so that it is easier to visually identify the failed tests, and the removal of # should reduce the clutter on the line and aid the eye to spot the test number better.
* Fixed t0000-basic.sh and test-lib.sh permissionsPetr Baudis2005-05-14
| | | | | The +x bit was missing. I applied the original patch three times and set the permissions correctly two times. Guess which was the time I forgot.
* [PATCH 1/2] Test framework take two.Junio C Hamano2005-05-14
This adds t/ directory to host test suite, a test helper library and a basic set of tests. Petr Baudis raised many valid points at the earlier attempts in git mailing list. This round, test-lib.sh has been updated to a bit more modern style, and the default output is made easier to read. Also included is one sample test script that tests the very basics. This test has already found one leftover bug missed when we introduced symlink support, which has been fixed since then. The supplied Makefile is designed to run all the available tests. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>