~ubuntu-branches/debian/sid/git/sid

« back to all changes in this revision

Viewing changes to t/README

  • Committer: Package Import Robot
  • Author(s): Jonathan Nieder
  • Date: 2013-06-12 07:50:53 UTC
  • mfrom: (1.2.19) (2.1.31 experimental)
  • Revision ID: package-import@ubuntu.com-20130612075053-uue9xe0dq0rvm44y
Tags: 1:1.8.3.1-1
* merge branch debian-experimental
* new upstream point release (see RelNotes/1.8.3.1.txt).
* debian/watch: use xz-compressed tarballs from kernel.org.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
 
87
87
--immediate::
88
88
        This causes the test to immediately exit upon the first
89
 
        failed test.
 
89
        failed test. Cleanup commands requested with
 
90
        test_when_finished are not executed if the test failed,
 
91
        in order to keep the state for inspection by the tester
 
92
        to diagnose the bug.
90
93
 
91
94
--long-tests::
92
95
        This causes additional long-running tests to be run (where
93
96
        available), for more exhaustive testing.
94
97
 
95
 
--valgrind::
96
 
        Execute all Git binaries with valgrind and exit with status
97
 
        126 on errors (just like regular tests, this will only stop
98
 
        the test script when running under -i).  Valgrind errors
99
 
        go to stderr, so you might want to pass the -v option, too.
 
98
--valgrind=<tool>::
 
99
        Execute all Git binaries under valgrind tool <tool> and exit
 
100
        with status 126 on errors (just like regular tests, this will
 
101
        only stop the test script when running under -i).
100
102
 
101
103
        Since it makes no sense to run the tests with --valgrind and
102
104
        not see any output, this option implies --verbose.  For
103
105
        convenience, it also implies --tee.
104
106
 
105
 
        Note that valgrind is run with the option --leak-check=no,
 
107
        <tool> defaults to 'memcheck', just like valgrind itself.
 
108
        Other particularly useful choices include 'helgrind' and
 
109
        'drd', but you may use any tool recognized by your valgrind
 
110
        installation.
 
111
 
 
112
        As a special case, <tool> can be 'memcheck-fast', which uses
 
113
        memcheck but disables --track-origins.  Use this if you are
 
114
        running tests in bulk, to see if there are _any_ memory
 
115
        issues.
 
116
 
 
117
        Note that memcheck is run with the option --leak-check=no,
106
118
        as the git process is short-lived and some errors are not
107
119
        interesting. In order to run a single command under the same
108
120
        conditions manually, you should set GIT_VALGRIND to point to
307
319
   Use test_done instead if you need to stop the tests early (see
308
320
   "Skipping tests" below).
309
321
 
 
322
 - use '! git cmd' when you want to make sure the git command exits
 
323
   with failure in a controlled way by calling "die()".  Instead,
 
324
   use 'test_must_fail git cmd'.  This will signal a failure if git
 
325
   dies in an unexpected way (e.g. segfault).
 
326
 
 
327
   On the other hand, don't use test_must_fail for running regular
 
328
   platform commands; just use '! cmd'.
 
329
 
 
330
 - use perl without spelling it as "$PERL_PATH". This is to help our
 
331
   friends on Windows where the platform Perl often adds CR before
 
332
   the end of line, and they bundle Git with a version of Perl that
 
333
   does not do so, whose path is specified with $PERL_PATH.
 
334
 
 
335
 - use sh without spelling it as "$SHELL_PATH", when the script can
 
336
   be misinterpreted by broken platform shell (e.g. Solaris).
 
337
 
 
338
 - chdir around in tests.  It is not sufficient to chdir to
 
339
   somewhere and then chdir back to the original location later in
 
340
   the test, as any intermediate step can fail and abort the test,
 
341
   causing the next test to start in an unexpected directory.  Do so
 
342
   inside a subshell if necessary.
 
343
 
310
344
 - Break the TAP output
311
345
 
312
346
   The raw output from your test may be interpreted by a TAP harness. TAP
342
376
of the test_* functions (see the "Test harness library" section
343
377
below), e.g.:
344
378
 
345
 
    test_expect_success PERL 'I need Perl' "
346
 
        '$PERL_PATH' -e 'hlagh() if unf_unf()'
347
 
    "
 
379
    test_expect_success PERL 'I need Perl' '
 
380
        "$PERL_PATH" -e "hlagh() if unf_unf()"
 
381
    '
348
382
 
349
383
The advantage of skipping tests like this is that platforms that don't
350
384
have the PERL and other optional dependencies get an indication of how
591
625
   The process retains the same pid across exec(2). See fb9a2bea for
592
626
   details.
593
627
 
 
628
 - PIPE
 
629
 
 
630
   The filesystem we're on supports creation of FIFOs (named pipes)
 
631
   via mkfifo(1).
 
632
 
594
633
 - SYMLINKS
595
634
 
596
635
   The filesystem we're on supports symbolic links. E.g. a FAT
606
645
   Git was compiled with USE_LIBPCRE=YesPlease. Wrap any tests
607
646
   that use git-grep --perl-regexp or git-grep -P in these.
608
647
 
 
648
 - CASE_INSENSITIVE_FS
 
649
 
 
650
   Test is run on a case insensitive file system.
 
651
 
 
652
 - UTF8_NFD_TO_NFC
 
653
 
 
654
   Test is run on a filesystem which converts decomposed utf-8 (nfd)
 
655
   to precomposed utf-8 (nfc).
 
656
 
609
657
Tips for Writing Tests
610
658
----------------------
611
659