Diff for /wikisrc/tutorials/atf.mdwn between versions 1.10 and 1.11

version 1.10, 2010/09/03 21:29:36 version 1.11, 2011/01/10 13:46:12
Line 297  specific details as to how this works fo Line 297  specific details as to how this works fo
   
 This program needs to be built with the Makefile shown below.  Once built, the  This program needs to be built with the Makefile shown below.  Once built, the
 program automatically gains a main() method that provides a consistent user  program automatically gains a main() method that provides a consistent user
 interface to all test programs.  You are simply not inteded to provide your own  interface to all test programs.  You are simply not intended to provide your own
 main method, nor to deal with the command-line of the invocation.  main method, nor to deal with the command-line of the invocation.
   
 ## How to build  ## How to build
Line 320  For example: Line 320  For example:
 The following functions are commonly used from within a test case body:  The following functions are commonly used from within a test case body:
   
 * ATF_REQUIRE(boolean_expression): Checks if the given boolean expression is  * ATF_REQUIRE(boolean_expression): Checks if the given boolean expression is
   true and, if not, aborts exectuion and markts the test as failed.  Similarly    true and, if not, aborts execution and marks the test as failed.  Similarly
   ATF_CHECK performs the same test but does not abort execution: it records the    ATF_CHECK performs the same test but does not abort execution: it records the
   failure but keeps processing the test case.  For an explanation on when to use    failure but keeps processing the test case.  For an explanation on when to use
   which, refer to the FAQ question below.    which, refer to the FAQ question below.
Line 355  The following functions are commonly use Line 355  The following functions are commonly use
   an abrupt termination of the test case, be it due to a call to exit() or to    an abrupt termination of the test case, be it due to a call to exit() or to
   the reception of a signal.    the reception of a signal.
   
 * atf_expect_exit(int exitcode, const char *fomat, ...): Same as atf_expect_fail  * atf_expect_exit(int exitcode, const char *format, ...): Same as atf_expect_fail
   but expects the test case to exit with a specific exitcode.  Provide -1 to    but expects the test case to exit with a specific exitcode.  Provide -1 to
   indicate any exit code.    indicate any exit code.
   
 * atf_expect_signal(int signo, const char *fomat, ...): Same as atf_expect_fail  * atf_expect_signal(int signo, const char *format, ...): Same as atf_expect_fail
   but expects the test case to receive a specific signal.  Provide -1 to    but expects the test case to receive a specific signal.  Provide -1 to
   indicate any signal.    indicate any signal.
   
Line 424  The details on how this works are provid Line 424  The details on how this works are provid
   
 This program needs to be built with the Makefile shown below.  The program  This program needs to be built with the Makefile shown below.  The program
 automatically gains an entry point that provides a consistent user interface to  automatically gains an entry point that provides a consistent user interface to
 all test programs.  You are simply not inteded to provide your own "main  all test programs.  You are simply not intended to provide your own "main
 method", nor to deal with the command-line of the invocation.  method", nor to deal with the command-line of the invocation.
   
 ## How to build  ## How to build
Line 467  The following functions are commonly use Line 467  The following functions are commonly use
   
 * atf_skip reason: Explicitly marks the test case as skipped and exits.  * atf_skip reason: Explicitly marks the test case as skipped and exits.
   
 * atf_pass: Explicitly markts the test case as passed and exits.  * atf_pass: Explicitly marks the test case as passed and exits.
   
 * atf_get_srcdir: Prints the path to the directory where the test case lives.  * atf_get_srcdir: Prints the path to the directory where the test case lives.
   Use as $(atf_get_srcdir)/my-static-data-file.    Use as $(atf_get_srcdir)/my-static-data-file.
Line 519  keep this in mind: Line 519  keep this in mind:
   
 * Use the ATF_CHECK* and/or atf_tc_fail functions to do the comparisons and  * Use the ATF_CHECK* and/or atf_tc_fail functions to do the comparisons and
   report errors.  Neither errx nor any other error reporting and program    report errors.  Neither errx nor any other error reporting and program
   termination functions (read: err, errx, warn, warnx, exit, abor) are to be    termination functions (read: err, errx, warn, warnx, exit, abort) are to be
   used at all.    used at all.
   
 The result would look like:  The result would look like:

Removed from v.1.10  
changed lines
  Added in v.1.11


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb