t/README: Document test_external*
There was do documentation for the test_external_without_stderr and test_external functions. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Jul 2, 2010 at 14:59 UTC
2fac6a4b93c29c0e7226337d76097ea1e61e072d
1 file changed
+27
t/README
+27
@@ -330,6 +330,33 @@ library for your script to use.
330
test_done
331
fi
332
333
+ - test_external [<prereq>] <message> <external> <script>
334
+
335
+ Execute a <script> with an <external> interpreter (like perl). This
336
+ was added for tests like t9700-perl-git.sh which do most of their
337
+ work in an external test script.
338
+
339
+ test_external \
340
+ 'GitwebCache::*FileCache*' \
341
+ "$PERL_PATH" "$TEST_DIRECTORY"/t9503/test_cache_interface.pl
342
+
343
+ If the test is outputting its own TAP you should set the
344
+ test_external_has_tap variable somewhere before calling the first
345
+ test_external* function. See t9700-perl-git.sh for an example.
346
+
347
+ # The external test will outputs its own plan
348
+ test_external_has_tap=1
349
+
350
+ - test_external_without_stderr [<prereq>] <message> <external> <script>
351
+
352
+ Like test_external but fail if there's any output on stderr,
353
+ instead of checking the exit code.
354
+
355
+ test_external_without_stderr \
356
+ 'Perl API' \
357
+ "$PERL_PATH" "$TEST_DIRECTORY"/t9700/test.pl
358
+
359
+
360
Tips for Writing Tests
361
----------------------
362