m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/tests/generate.awk,v


From: Eric Blake
Subject: Changes to m4/tests/generate.awk,v
Date: Thu, 19 Oct 2006 16:19:22 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Eric Blake <ericb>      06/10/19 16:19:20

Index: tests/generate.awk
===================================================================
RCS file: /sources/m4/m4/tests/generate.awk,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- tests/generate.awk  4 Oct 2006 23:30:46 -0000       1.21
+++ tests/generate.awk  19 Oct 2006 16:19:20 -0000      1.22
@@ -22,7 +22,7 @@
 
 BEGIN {
   seq = -1;
-  status = xfail = 0;
+  status = xfail = examples = 0;
   file = options = "";
   print "# This file is part of the GNU m4 test suite.  -*- Autotest -*-";
   # I don't know how to get this file's name, so it's hard coded :(
@@ -35,7 +35,7 @@
   print ;
 }
 
-/address@hidden / {
+/address@hidden / { # Start a new test group.
   if (seq > 0)
     print "AT_CLEANUP";
 
@@ -44,31 +44,35 @@
   seq = 0;
 }
 
-/address@hidden file: / {
+/address@hidden file: / { # Produce a data file instead of a test.
   file = $3;
 }
 
-/address@hidden options: / {
+/address@hidden options: / { # Pass additional options to m4.
   options = $0;
   gsub ("@comment options:", "", options);
 }
 
-/address@hidden xfail$/ {
+/address@hidden xfail$/ { # Expect the test to fail.
   xfail = 1;
 }
 
-/address@hidden ignore$/ {
+/address@hidden examples$/ { # The test uses files from the examples dir.
+  examples = 1;
+}
+
+/address@hidden ignore$/ { # This is just formatted doc text, not an actual 
test.
   getline;
-  status = xfail = 0;
+  status = xfail = examples = 0;
   options = file = "";
   next;
 }
 
-/address@hidden status: / {
+/address@hidden status: / { # Expected exit status of a test.
   status = $3;
 }
 
-/address@hidden/, /address@hidden example$/ {
+/address@hidden/, /address@hidden example$/ { # The body of the test.
   if (seq < 0)
     next;
 
@@ -97,9 +101,9 @@
        }
       else
        {
-         new_test(input, status, output, error, options, xfail);
+         new_test(input, status, output, error, options, xfail, examples);
        }
-      status = xfail = 0;
+      status = xfail = examples = 0;
       file = input = output = error = options = "";
       next;
     }
@@ -162,7 +166,7 @@
   printf ("AT_KEYWORDS([[documentation]])\n\n");
 }
 
-function new_test(input, status, output, error, options, xfail) {
+function new_test(input, status, output, error, options, xfail, examples) {
   input = normalize(input);
   output = normalize(output);
   error = normalize(error);
@@ -172,18 +176,18 @@
   if (xfail == 1)
     printf ("AT_XFAIL_IF([:])\n");
 
-  if (options ~ /-I/)
+  if (examples == 1)
     {
       printf ("AT_DATA([expout1],\n[[%s]])\n", output);
-      printf ("sed -e \"s|\\\\.\\\\./examples|"\
-             "$abs_top_srcdir/examples|g\" \\\n");
+      printf ("sed -e \"s|examples|$abs_top_srcdir/examples|g\" \\\n");
       printf ("  < expout1 > expout\n\n");
+      options = options " -I\"$abs_top_srcdir/examples\"";
     }
 
   printf ("AT_DATA([[input.m4]],\n[[%s]])\n\n", input);
   # Some of these tests `include' files from tests/.
   printf ("AT_CHECK_M4([[%s input.m4]], %s,", options, status);
-  if (options ~ /-I/)
+  if (examples == 1)
     printf ("\n[expout]");
   else if (output)
     printf ("\n[[%s]]", output);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]