INN commit: trunk (4 files)

INN Commit rra at isc.org
Mon Oct 27 19:42:35 UTC 2014


    Date: Monday, October 27, 2014 @ 12:42:34
  Author: iulius
Revision: 9731

Update to latest C TAP Harness upstream version

Also add a missing last NULL argument to new_skip() and new_skip_block()
functions, kept for compatibility with tests using the old syntax of
C TAP Harness.

Modified:
  trunk/support/getc-tap-harness
  trunk/tests/runtests.c
  trunk/tests/tap/basic.c
  trunk/tests/tap/basic.h

--------------------------+
 support/getc-tap-harness |    4 ++--
 tests/runtests.c         |   20 +++++++++++++-------
 tests/tap/basic.c        |    6 +++---
 tests/tap/basic.h        |    2 +-
 4 files changed, 19 insertions(+), 13 deletions(-)

Modified: support/getc-tap-harness
===================================================================
--- support/getc-tap-harness	2014-10-03 16:28:00 UTC (rev 9730)
+++ support/getc-tap-harness	2014-10-27 19:42:34 UTC (rev 9731)
@@ -104,7 +104,7 @@
 void\\
 skip(int n UNUSED, const char *reason)\\
 {\\
-    new_skip(reason);\\
+    new_skip(reason, NULL);\\
 }\\
 \\
 void\\
@@ -116,7 +116,7 @@
 void\\
 skip_block(int n UNUSED, int count, const char *reason)\\
 {\\
-    new_skip_block(count, reason);\\
+    new_skip_block(count, reason, NULL);\\
 }\\
 \\
 void\\

Modified: tests/runtests.c
===================================================================
--- tests/runtests.c	2014-10-03 16:28:00 UTC (rev 9730)
+++ tests/runtests.c	2014-10-27 19:42:34 UTC (rev 9731)
@@ -4,16 +4,20 @@
  *
  * Usage:
  *
- *      runtests [-b <build-dir>] [-s <source-dir>] <test-list>
+ *      runtests [-b <build-dir>] [-s <source-dir>] -l <test-list>
+ *      runtests [-b <build-dir>] [-s <source-dir>] <test> [<test> ...]
  *      runtests -o [-b <build-dir>] [-s <source-dir>] <test>
  *
  * In the first case, expects a list of executables located in the given file,
  * one line per executable.  For each one, runs it as part of a test suite,
- * reporting results.  Test output should start with a line containing the
- * number of tests (numbered from 1 to this number), optionally preceded by
- * "1..", although that line may be given anywhere in the output.  Each
- * additional line should be in the following format:
+ * reporting results.  In the second case, use the same infrastructure, but
+ * run only the tests listed on the command line.
  *
+ * Test output should start with a line containing the number of tests
+ * (numbered from 1 to this number), optionally preceded by "1..", although
+ * that line may be given anywhere in the output.  Each additional line should
+ * be in the following format:
+ *
  *      ok <number>
  *      not ok <number>
  *      ok <number> # skip
@@ -1419,19 +1423,21 @@
     int single = 0;
     char *source_env = NULL;
     char *build_env = NULL;
+    const char *program;
     const char *shortlist;
     const char *list = NULL;
     const char *source = SOURCE;
     const char *build = BUILD;
     struct testlist *tests;
 
+    program = argv[0];
     while ((option = getopt(argc, argv, "b:hl:os:")) != EOF) {
         switch (option) {
         case 'b':
             build = optarg;
             break;
         case 'h':
-            printf(usage_message, argv[0], argv[0], argv[0], usage_extra);
+            printf(usage_message, program, program, program, usage_extra);
             exit(0);
             break;
         case 'l':
@@ -1450,7 +1456,7 @@
     argv += optind;
     argc -= optind;
     if ((list == NULL && argc < 1) || (list != NULL && argc > 0)) {
-        fprintf(stderr, usage_message, argv[0], argv[0], argv[0], usage_extra);
+        fprintf(stderr, usage_message, program, program, program, usage_extra);
         exit(1);
     }
 

Modified: tests/tap/basic.c
===================================================================
--- tests/tap/basic.c	2014-10-03 16:28:00 UTC (rev 9730)
+++ tests/tap/basic.c	2014-10-27 19:42:34 UTC (rev 9731)
@@ -71,7 +71,7 @@
 void
 skip(int n UNUSED, const char *reason)
 {
-    new_skip(reason);
+    new_skip(reason, NULL);
 }
 
 void
@@ -83,7 +83,7 @@
 void
 skip_block(int n UNUSED, int count, const char *reason)
 {
-    new_skip_block(count, reason);
+    new_skip_block(count, reason, NULL);
 }
 
 void
@@ -153,7 +153,7 @@
 /*
  * Registered diag files.  Any output found in these files will be printed out
  * as if it were passed to diag() before any other output we do.  This allows
- * background processes to log to a file and have that output interleved with
+ * background processes to log to a file and have that output interleaved with
  * the test output.
  */
 struct diag_file {

Modified: tests/tap/basic.h
===================================================================
--- tests/tap/basic.h	2014-10-03 16:28:00 UTC (rev 9730)
+++ tests/tap/basic.h	2014-10-27 19:42:34 UTC (rev 9731)
@@ -181,7 +181,7 @@
  * registered functions will be run during atexit handling (and are therefore
  * subject to all the same constraints and caveats as atexit functions).
  *
- * The function must return void and will be passed two argument, an int that
+ * The function must return void and will be passed two arguments: an int that
  * will be true if the test completed successfully and false otherwise, and an
  * int that will be true if the cleanup function is run in the primary process
  * (the one that called plan or plan_lazy) and false otherwise.



More information about the inn-committers mailing list