<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t0000-basic.sh, branch v1.6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2009-03-22T16:26:44Z</updated>
<entry>
<title>Use prerequisite tags to skip tests that depend on symbolic links</title>
<updated>2009-03-22T16:26:44Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2009-03-04T21:38:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=704a3143d5ba0709727430154ef3dad600aad4de'/>
<id>urn:sha1:704a3143d5ba0709727430154ef3dad600aad4de</id>
<content type='text'>
Many tests depend on that symbolic links work.  This introduces a check
that sets the prerequisite tag SYMLINKS if the file system supports
symbolic links.  Since so many tests have to check for this prerequisite,
we do the check in test-lib.sh, so that we don't need to repeat the test
in many scripts.

To check for 'ln -s' failures, you can use a FAT partition on Linux:

$ mkdosfs -C git-on-fat 1000000
$ sudo mount -o loop,uid=j6t,gid=users,shortname=winnt git-on-fat /mnt

Clone git to /mnt and

$ GIT_SKIP_TESTS='t0001.1[34] t0010 t1301 t403[34] t4129.[47] t5701.7
          t7701.3 t9100 t9101.26 t9119 t9124.[67] t9200.10 t9600.6' \
        make test

(These additionally skipped tests depend on POSIX permissions that FAT on
Linux does not provide.)

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
</content>
</entry>
<entry>
<title>test-lib: Infrastructure to test and check for prerequisites</title>
<updated>2009-03-21T20:09:27Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2009-03-01T20:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a7bb394037e1c32d47d0b04da025bdbe2eb78d66'/>
<id>urn:sha1:a7bb394037e1c32d47d0b04da025bdbe2eb78d66</id>
<content type='text'>
Some tests can be run only if a particular prerequisite is available. For
example, some tests require that an UTF-8 locale is available. Here we
introduce functions that are used in this way:

1. Insert code that checks whether the prerequisite is available. If it is,
   call test_set_prereq with an arbitrary tag name that subsequently can be
   used to check for the prerequisite:

      case $LANG in
      *.utf-8)
            test_set_prereq UTF8
            ;;
      esac

2. In the calls to test_expect_success pass the tag name:

      test_expect_success UTF8 '...description...' '...tests...'

3. There is an auxiliary predicate that can be used anywhere to test for
   a prerequisite explicitly:

      if test_have_prereq UTF8
      then
            ...code to be skipped if prerequisite is not available...
      fi

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
</content>
</entry>
<entry>
<title>Tests: use test_cmp instead of diff where possible</title>
<updated>2009-03-17T21:25:52Z</updated>
<author>
<name>Miklos Vajna</name>
<email>vmiklos@frugalware.org</email>
</author>
<published>2009-03-16T20:18:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=188c3827c10f5a04588ef7af8b63a7b5dbcc38ed'/>
<id>urn:sha1:188c3827c10f5a04588ef7af8b63a7b5dbcc38ed</id>
<content type='text'>
Several old tests were written before test_cmp was introduced, convert
these to test_cmp.

If were are at it, fix the order of the arguments where necessary to
make expected come first, so the command shows how the test result
deviates from the correct output.

Signed-off-by: Miklos Vajna &lt;vmiklos@frugalware.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/: Use "test_must_fail git" instead of "! git"</title>
<updated>2008-07-13T20:21:26Z</updated>
<author>
<name>Stephan Beyer</name>
<email>s-beyer@gmx.net</email>
</author>
<published>2008-07-12T15:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d492b31cafe9aa5ce001b1d48815f4c0bb40d01a'/>
<id>urn:sha1:d492b31cafe9aa5ce001b1d48815f4c0bb40d01a</id>
<content type='text'>
This patch changes every occurrence of "! git" -- with the meaning
that a git call has to gracefully fail -- into "test_must_fail git".

This is useful to

 - make sure the test does not fail because of a signal,
   e.g. SIGSEGV, and

 - advertise the use of "test_must_fail" for new tests.

Signed-off-by: Stephan Beyer &lt;s-beyer@gmx.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fold test-absolute-path into test-path-utils</title>
<updated>2008-05-23T21:15:01Z</updated>
<author>
<name>David Reiss</name>
<email>dreiss@facebook.com</email>
</author>
<published>2008-05-20T06:49:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d553e737897e8edbbc2092bf345fc58b2dae5251'/>
<id>urn:sha1:d553e737897e8edbbc2092bf345fc58b2dae5251</id>
<content type='text'>
Signed-off-by: David Reiss &lt;dreiss@facebook.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix tests breaking when checkout path contains shell metacharacters</title>
<updated>2008-05-05T21:37:02Z</updated>
<author>
<name>Bryan Donlan</name>
<email>bdonlan@fushizen.net</email>
</author>
<published>2008-05-04T05:37:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f69e836fab2b634281d92a0d304de4d768e479cc'/>
<id>urn:sha1:f69e836fab2b634281d92a0d304de4d768e479cc</id>
<content type='text'>
This fixes the remainder of the issues where the test script itself is at
fault for failing when the git checkout path contains whitespace or other
shell metacharacters.

The majority of git svn tests used the idiom

  test_expect_success "title" "test script using $svnrepo"

These were changed to have the test script in single-quotes:

  test_expect_success "title" 'test script using "$svnrepo"'

which unfortunately makes the patch appear larger than it really is.

One consequence of this change is that in the verbose test output the
value of $svnrepo (and in some cases other variables, too) is no
longer expanded, i.e. previously we saw

  * expecting success:
	test script using /path/to/git/t/trash/svnrepo

but now it is:

  * expecting success:
	test script using "$svnrepo"

Signed-off-by: Bryan Donlan &lt;bdonlan@fushizen.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix make_absolute_path() for parameters without a slash</title>
<updated>2008-03-02T09:58:31Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2008-03-02T07:40:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e371a4c648e72673fcfdf0b45192857dd149e2f5'/>
<id>urn:sha1:e371a4c648e72673fcfdf0b45192857dd149e2f5</id>
<content type='text'>
When passing "xyz" to make_absolute_path(), make_absolute_path()
erroneously tried to chdir("xyz"), and then append "/xyz".  Instead,
skip the chdir() completely when no slash was found.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'lt/in-core-index'</title>
<updated>2008-02-12T00:46:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-02-12T00:46:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0197c9aae39b0f1ba6c21d1f6d0bae5de03a44d'/>
<id>urn:sha1:e0197c9aae39b0f1ba6c21d1f6d0bae5de03a44d</id>
<content type='text'>
* lt/in-core-index:
  lazy index hashing
  Create pathname-based hash-table lookup into index
  read-cache.c: introduce is_racy_timestamp() helper
  read-cache.c: fix a couple more CE_REMOVE conversion
  Also use unpack_trees() in do_diff_cache()
  Make run_diff_index() use unpack_trees(), not read_tree()
  Avoid running lstat(2) on the same cache entry.
  index: be careful when handling long names
  Make on-disk index representation separate from in-core one
</content>
</entry>
<entry>
<title>Sane use of test_expect_failure</title>
<updated>2008-02-02T04:49:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-02-01T09:50:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41ac414ea2bef81af94474cbef25a38868b4788e'/>
<id>urn:sha1:41ac414ea2bef81af94474cbef25a38868b4788e</id>
<content type='text'>
Originally, test_expect_failure was designed to be the opposite
of test_expect_success, but this was a bad decision.  Most tests
run a series of commands that leads to the single command that
needs to be tested, like this:

    test_expect_{success,failure} 'test title' '
	setup1 &amp;&amp;
        setup2 &amp;&amp;
        setup3 &amp;&amp;
        what is to be tested
    '

And expecting a failure exit from the whole sequence misses the
point of writing tests.  Your setup$N that are supposed to
succeed may have failed without even reaching what you are
trying to test.  The only valid use of test_expect_failure is to
check a trivial single command that is expected to fail, which
is a minority in tests of Porcelain-ish commands.

This large-ish patch rewrites all uses of test_expect_failure to
use test_expect_success and rewrites the condition of what is
tested, like this:

    test_expect_success 'test title' '
	setup1 &amp;&amp;
        setup2 &amp;&amp;
        setup3 &amp;&amp;
        ! this command should fail
    '

test_expect_failure is redefined to serve as a reminder that
that test *should* succeed but due to a known breakage in git it
currently does not pass.  So if git-foo command should create a
file 'bar' but you discovered a bug that it doesn't, you can
write a test like this:

    test_expect_failure 'git-foo should create bar' '
        rm -f bar &amp;&amp;
        git foo &amp;&amp;
        test -f bar
    '

This construct acts similar to test_expect_success, but instead
of reporting "ok/FAIL" like test_expect_success does, the
outcome is reported as "FIXED/still broken".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>index: be careful when handling long names</title>
<updated>2008-01-21T20:44:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-01-19T07:42:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7fec10b7f41fa32e71aa6377bd04cd7c6fb419e0'/>
<id>urn:sha1:7fec10b7f41fa32e71aa6377bd04cd7c6fb419e0</id>
<content type='text'>
We currently use lower 12-bit (masked with CE_NAMEMASK) in the
ce_flags field to store the length of the name in cache_entry,
without checking the length parameter given to
create_ce_flags().  This can make us store incorrect length.

Currently we are mostly protected by the fact that many
codepaths first copy the path in a variable of size PATH_MAX,
which typically is 4096 that happens to match the limit, but
that feels like a bug waiting to happen.  Besides, that would
not allow us to shorten the width of CE_NAMEMASK to use the bits
for new flags.

This redefines the meaning of the name length stored in the
cache_entry.  A name that does not fit is represented by storing
CE_NAMEMASK in the field, and the actual length needs to be
computed by actually counting the bytes in the name[] field.
This way, only the unusually long paths need to suffer.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
