summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2005-08-14[PATCH] fix null TZ problems on os/xBrad Roberts
It seems that the localtime() libc routine doesn't care for finding a TZ that's empty. It's ok with TZ not being set. Setting the TZ to GMT allowed these tests to pass. $ uname -v Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Signed-off-by: Brad Roberts <braddr@puremagic.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-12[PATCH] Trapping exit in tests, using return for errors: further fixes.Pavel Roskin
"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>
2005-08-12[PATCH] Trapping exit in tests, using return for errorsPavel Roskin
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>
2005-08-12[PATCH] Need to set PAGER in testsPavel Roskin
"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>
2005-08-12[PATCH] Missing test_donePavel Roskin
All test scripts should end with test_done, which reports the test results. In the future, it could be used for other purposes, e.g. to distinguish graceful end from "exit" in a test. This patch fixes scripts that don't call test_done. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-12String comparison of test is done with '=', not '=='.Junio C Hamano
Caught this during a test setting /bin/sh to (d)ash. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-10[PATCH] Fix git-rev-parse's parent handlingJohannes Schindelin
git-rev-parse HEAD^1 would fail, because of an off-by-one bug (but HEAD^ would yield the expected result). Also, when the parent does not exist, do not silently return an incorrect SHA1. Of course, this no longer applies to git-rev-parse alone, but every user of get_sha1(). While at it, add a test. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-30Skip --merge-order test when built with NO_OPENSSLJunio C Hamano
When built with NO_OPENSSL, rev-list --merge-order does not work, causing t6001 test to fail. Detect that and skip this test to allow continuing to the rest of the tests. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-30Documentation and tests: ls-files exclude pattern.Junio C Hamano
Update the tests and documentation to match the new "last one determines its fate" semantics. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-29[PATCH] support bc version 1.04Johannes Schindelin
Test t6002 unnecessarily fails when bc is a bit older than average. Signed-off-by: Johannes.Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-27Fix potential send-pack SIGSEGVLinus Torvalds
The check that the source is ahead of the destination incorrectly expects pop_most_recent_commit() to gracefully handle an empty list. Fix by just checking the list itself, rather than the return value of the pop function. [jc: I did the test script that demonstrated the problem] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-26Adjust diff-raw tests to the status letter change.Junio C Hamano
We use 'A' for added files instead of 'N' to make the it visually easier to distinguish from 'M' now. While we are at it, make the test scripts executable. Yes, I know it does not matter because t/Makefile runs them explicitly with "sh tXXXX-blah.sh", but being consistent is always better. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-26git-ls-files: --exclude mechanism updates.Junio C Hamano
Add --exclude-per-directory=<name> option that specifies a file to contain exclude patterns local to that directory and its subdirectories. Update the exclusion logic to be able to say "include files that match this more specific pattern, even though later exclude patterns may match them". Also enhances that a pattern can contain '/' in which case fnmatch is called with FNM_PATHNAME flag to match the entire path. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-23[PATCH] Test framework: prettyprint the failed command.Junio C Hamano
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>
2005-07-22[PATCH] apply.c: handle incomplete lines correctly.Junio C Hamano
The parsing code had a bug that failed to recognize an incomplete line at the end of a fragment, and the fragment application code had a comparison bug to recognize such. Fix them to handle incomplete lines correctly. Add a test script for patches with various combinations of complete and incomplete lines to make sure the fix works. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-07[PATCH] Prevent t6000 series from dropping useless sed.script in t/Junio C Hamano
The Makefile in the test suite directory considers any file matching t[0-9][0-9][0-9][0-9]-*.sh as the top-level test script to be executed. Unfortunately this was not documented, and the common test library, t6000-lib.sh was named to match that pattern. This caused t6000-lib.sh to be called from Makefile as the top-level program, causing it to leave t/sed.script file behind. Rename it to t6000lib.sh to prevent this, and document the naming convention a bit more clearly. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-07[PATCH] Write sed script directly into temp file, rather than a variableJon Seymour
When sed uses \n rather than ; as a separator (for BSD sed(1) compat), it is cleaner to use a file directly, rather than an environment variable containing \n characters. This change changes t/t6000 write to sed.script directly and changes the other tests to remove knowledge of sed.script. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-07[PATCH] Add t/t6003 with some --topo-order testsJon Seymour
Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Add a t/t6001 test case for a --merge-order bugJon Seymour
This test case demonstrates a problem with --merge-order. A | B |\ C D |/ E | F git-rev-list --merge-order A B doesn't produce the expected output of A B D C E F The problem is fixed by a subsequent patch. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Change the sed seperator in t/t6000-lib.sh.Jon Seymour
This trivial patch removes the semicolon as the sed seperator in the t/t6000-lib.sh test script and replaces it with white space. This makes BSD sed(1) much happier. Signed-off-by: Mark Allen <mrallen1@yahoo.com> Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Introduce unit tests for git-rev-list --bisectJon Seymour
This patch introduces some unit tests for the git-rev-list --bisect functionality. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Factor out useful test case infrastructure from t/t6001... into ↵Jon Seymour
t/t6000-lib.sh Functions that are useful to other t6xxx testcases are moved into t6000-lib.sh To use these functions in a test case, use a test-case pre-amble like: . ./test-lib.sh . ../t6000-lib.sh # t6xxx specific functions Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-04[PATCH] Fixup t/t5300 unit tests broken by ↵Jon Seymour
5f3de58ff85c49620ae2a1722d8d4d37c881a054 This patch fixes up the t/t5300 unit tests which were broken by the changes in: Make the name of a pack-file depend on the objects packed there-in. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-30[PATCH] Remove unnecessary sort from t6001 testcaseJon Seymour
This patch removes an unnecessary sort from the t6001 testcase. Sorts were previously necessary when testing non --merge-order cases because the output order wasn't entirely deterministic unless commit date was fixed. However, commit dates are now fixed, so the need for a sort has disappeared. So the sort has been removed. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-30[PATCH] Fix broken t6001 test caseJon Seymour
This fix fixes a t/t6001 test case break that was hidden by a bug in the test case infrastructure. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-30[PATCH] Demonstrate broken t6001 test case functionJon Seymour
Junio discovered a problem where an actual test case break was hidden because pipelines are not handled properly by the test infrastructure in t6001. This patch fixes the broken infrastructure (and demonstrates the break explicitly). A subsequent patch in this series will fix the test case so that it doesn't fail. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-30[PATCH] Fix for git-rev-list --merge-order B ^A (A,B share common base) [rev 2]Jon Seymour
This patch makes --merge-order produce the same list as git-rev-list without --merge-order specified. In particular, if the graph looks like this: A | B |/ C | D The both git-rev-list B ^A and git-rev-list --merge-order will produce B. The unit tests have been changed to reflect the fact that the prune points are now formally part of the start list that is used to perform the --merge-order sort. That is: git-rev-list --merge-order A ^D used to produce = A | C It now produces: ^ A | C Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-30[PATCH] Test case that demonstrates problem with --merge-order ^ processingJon Seymour
Added a test case that shows that --merge-order doesn't produce the correct result in the following case. A | | B |/ C | D git-rev-list --merge-order A ^B should produce just A. Instead it produces BCD. A subsequent patch will fix this defect. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Adjust t5300 test for unpack-objects changeJunio C Hamano
It now always read from standard input and rejects non-flag arguments. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Add git-verify-pack command.Junio C Hamano
Given a list of <pack>.idx files, this command validates the index file and the corresponding .pack file for consistency. This patch also uses the same validation mechanism in fsck-cache when the --full flag is used. During normal operation, sha1_file.c verifies that a given .idx file matches the .pack file by comparing the SHA1 checksum stored in .idx file and .pack file as a minimum sanity check. We may further want to check the pack signature and version when we map the pack, but that would be a separate patch. Earlier, errors to map a pack file was not flagged fatal but led to a random fatal error later. This version explicitly die()s when such an error is detected. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-28Fix another test that broke with the recent git-init-db updateLinus Torvalds
t5300-pack-object.sh test 8 expected to have to create the "pack" directory itself, and was unhappy when it already existed.
2005-06-28[PATCH] replace sha1sum with sum in t/t1002Mark Allen
This replaces sha1sum(1) with sum(1) in t/t1002. GNU sum(1) runs in "BSD compatibility" mode by default, and not all systems have GNU coreutils. On any system without GNU coreutils (or sha1sum) t1002 will fail. This patch should make t1002 complete successfully everywhere that sum(1) runs. I've tested this on Darwin and Linux; it works on both platforms. Signed-off-by: Mark Allen <mrallen1@yahoo.com> Acked-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-28Fix up test that counted subdirectories in ".git/objects"Linus Torvalds
Now there are 257 of them (256 numeric ones, and the new "pack" directory)
2005-06-27[PATCH] Teach read_sha1_file() and friends about packed git object store.Junio C Hamano
GIT_OBJECT_DIRECTORY and GIT_ALTERNATE_OBJECT_DIRECTORIES can have the "pack" subdirectory that houses "packed GIT" files produced by git-pack-objects (e.g. .git/objects/pack/foo.pack and .git/objects/pack/foo.idx; always store them as pairs). The following functions in sha1_file.c can then read object contents from such packed file: - sha1_object_info() - has_sha1_file() - read_sha1_file() Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27[PATCH] Remove "delta" object representation.Junio C Hamano
Packed delta files created by git-pack-objects seems to be the way to go, and existing "delta" object handling code has exposed the object representation details to too many places. Remove it while we refactor code to come up with a proper interface in sha1_file.c. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-26[PATCH] Finish initial cut of git-pack-object/git-unpack-object pair.Junio C Hamano
This finishes the initial round of git-pack-object / git-unpack-object pair. They are now good enough to be used as a transport medium: - Fix delta direction in pack-objects; the original was computing delta to create the base object from the object to be squashed, which was quite unfriendly for unpacker ;-). - Add a script to test the very basics. - Implement unpacker for both regular and deltified objects. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-25[PATCH] Fix oversimplified optimization for add_cache_entry().Junio C Hamano
An earlier change to optimize directory-file conflict check broke what "read-tree --emu23" expects. This is fixed by this commit. (1) Introduces an explicit flag to tell add_cache_entry() not to check for conflicts and use it when reading an existing tree into an empty stage --- by definition this case can never introduce such conflicts. (2) Makes read-cache.c:has_file_name() and read-cache.c:has_dir_name() aware of the cache stages, and flag conflict only with paths in the same stage. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-25[PATCH] Add more tests for read-tree --emu23.Junio C Hamano
This adds more tests for --emu23. One is to show how it can carry forward more local changes than the straightforward two-way fast forward, and another is to show the recent overeager optimization of directory/file conflict check broke things, which will be fixed in the next commit. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-23[PATCH] A test case that demonstrates a problem with merges with two roots.Jon Seymour
git-rev-list --merge-order is omitting one of the roots when displaying a merge containing two distinct roots. A subsequent patch will fix the problem. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-22[PATCH] git-apply: tests for --stat and --summary.Junio C Hamano
This adds tests (which also serves demonstration) for the --stat and --summary flags to the git-apply command. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-20[PATCH] Additional git-rev-list unit tests to demonstrate problems that ↵Jon Seymour
require fixes 1. --merge-order doesn't deal properly with a specified head that has no parent * FAIL 11: head has no parent 2. --merge-order doesn't deal properly with arguments of the form head ^head * FAIL 30: head ^head --merge-order git-rev-list --merge-order --show-breaks a3 ^a3 3. if one of the specified heads is reachable from the other, the head gets printed twice and this causes problems for upcoming versions of gitk. This is true for both --merge-order and non --merge-order style of invocations. * FAIL 24: one specified head reachable from another a4, c3, --merge-order * FAIL 26: one specified head reachable from another a4, c3, no --merge-order * FAIL 27: one specified head reachable from another c3, a4, no --merge-order 4. --merge-order aborts with commits that list the same parent twice...it should handle it more gracefully. * no longer unit testable 5. broken interaction between --merge-order and --max-age previously posted as: "[PATCH 1/2] Test case that demonstrates problem with --merge-order, --max-age interaction" * FAIL 23: --max-age=c3, --merge-order Later patches in this patch set fix these problems. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-20[PATCH] Rework -B output.Junio C Hamano
Patch for a completely rewritten file detected by the -B flag was shown as a pair of creation followed by deletion in earlier versions. This was an misguided attempt to make reviewing such a complete rewrite easier, and unnecessarily ended up confusing git-apply. Instead, show the entire contents of old version prefixed with '-', followed by the entire contents of new version prefixed with '+'. This gives the same easy-to-review for human consumer while keeping it a single, regular modification patch for machine consumption, something that even GNU patch can grok. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-20[PATCH] Make -C less eager.Junio C Hamano
Like diff-tree, this patch makes -C option for diff-* brothers to use only pre-image of modified files as rename/copy detection by default. Give --find-copies-harder to use unmodified files to find copies from as well. This also fixes "diff-files -C" problem earlier noticed by Linus. It was feeding the null sha1 even when the file in the work tree was known to match what is in the index file. This resulted in diff-files showing everything in the project. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-14[PATCH] Unset TZ in t5000Mark Allen
Unset TZ to force GMT in test #4 and add a set of parens around the length function in the awk script. Signed-off-by: Mark Allen <mrallen1@yahoo.com> Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-13[PATCH] read-tree: loosen too strict index requirementsJunio C Hamano
This patch teaches read-tree 3-way merge that, when only "the other tree" changed a path, and if the index file already has the same change, we are not in a situation that would clobber the index and the work tree, and lets the merge succeed; this is case #14ALT in t1000 test. It does not change the result of the merge, but prevents it from failing when it does not have to. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-13[PATCH] Finish making --emu23 equivalent to pure 2-way merge.Junio C Hamano
This adds #3ALT rule (and #2ALT rule for symmetry) to the read-tree 3-way merge logic that collapses paths that are added only in one branch and not in the other internally. This makes --emu23 to succeed in the last remaining case where the pure 2-way merge succeeded and earlier one failed. Running diff between t1001 and t1005 test scripts shows that the only difference between the two is that --emu23 can leave the states into separate stages so that the user can use usual 3-way merge resolution techniques to carry forward the local changes when pure 2-way merge would have refused to run. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-13[PATCH] read-tree: fix too strong index requirement #5ALTJunio C Hamano
This fixes too strong index requirement 3-way merge enforces in one case: the same file is added in both branches. In this case, the original code insisted that if the index file has that path, it must match our branch and be up-to-date. However in this particular case, it only has to match it, and can be dirty. We just need to make sure that we keep the work-tree copy instead of checking out the merge result. The resolution of such a path, however, cannot be left to outside script, because we will not keep the original stage0 entries for unmerged paths when read-tree finishes, and at that point, the knowledge of "if we resolve it to match the new file added in both branches, the merge succeeds and the work tree would not lose information, but we should _not_ update the work tree from the resulting index file" is lost. For this reason, the now code needs to resolve this case (#5ALT) internally. This affects some existing tests in the test suite, but all in positive ways. In t1000 (3-way test), this #5ALT case now gets one stage0 entry, instead of an identical stage2 and stage3 entry pair, for such a path, and one test that checked for merge failure (because the test assumed the "stricter-than-necessary" behaviour) does not have to fail anymore. In t1005 (emu23 test), two tests that involves a case where the work tree already had a change introduced in the upstream (aka "merged head"), the merge succeeds instead of failing. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-13[PATCH] read-tree --emu23.Junio C Hamano
This new flag causes two-way fast forward to internally use the three-way merge mechanism. This behaviour is intended to offer a better fast forward semantics when used in a dirty work tree. The new test t1005 is parallel to the existing t1001 "pure 2-way" tests, but some parts that are commented out would fail. These failures are due to three-way merge enforcing too strict index requirements for cases that could succeed. This problem will be addressed by later patches. Without even changing three-way mechanism, the --emu23 two-way fast forward already gives the user an easier-to-handle merge result when a file that "merged head" updates has local modifications. This is demonstrated as "case 16" test in t1005. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-13[PATCH] Clean up read-tree two-way tests.Junio C Hamano
This is in preparation for "2-way fast-forward emulated with 3-way mechanism" series. It does not change what the tests for pure 2-way do. It only changes how it tests things, to make reviewing of differences of the two tests easier in later steps. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-08[PATCH] Add read-tree -m 3-way merge tests.Junio C Hamano
This adds a set of tests to make sure that requirements on existing cache entries are checked when a read-tree -m 3-way merge is run with an already populated index file. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>