/[m4]/m4/tests/generate.awk
ViewVC logotype

Diff of /m4/tests/generate.awk

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by gary, Wed Aug 29 19:59:09 2001 UTC revision 1.7 by akim, Mon Sep 3 15:05:13 2001 UTC
# Line 42  BEGIN { Line 42  BEGIN {
42    seq = 0;    seq = 0;
43  }  }
44    
45    /^@comment file: / {
46      file = $3;
47    }
48    
49  /^@comment ignore$/ {  /^@comment ignore$/ {
50    getline;    getline;
51    next;    next;
# Line 59  BEGIN { Line 63  BEGIN {
63      {      {
64        if (seq == 0)        if (seq == 0)
65          new_group(node);          new_group(node);
66        seq++;        if (!file)
67        printf ("# From example in %s line %d.\n\n", FILENAME, NR)          seq++;
68          printf ("# %s:%d\n", FILENAME, NR)
69        next;        next;
70      }      }
71    else if ($0 ~ /^@end example$/)  
72      if ($0 ~ /^@end example$/)
73      {      {
74        new_test(input, status, output, error);        if (file != "")
75        status = 0;          {
76        input = output = error = "";             if (output || error)
77                 {
78                   fatal("while getting file " file      \
79                         " found output = " output ","  \
80                         " found error = " error);
81    
82                 }
83               input = normalize(input);
84               printf ("# FOO: %s\n", file);
85               printf ("AT_DATA([[%s]],\n[[%s]])\n\n", file, input);
86            }
87          else
88            {
89               new_test(input, status, output, error);
90               status = 0;
91            }
92          file = input = output = error = "";
93        next;        next;
94      }      }
95    else if ($0 ~ /^\^D$/)  
96      if ($0 ~ /^\^D$/)
97      next;      next;
98    else if ($0 ~ /^@result\{\}/)  
99      if ($0 ~ /^@result\{\}/)
100      output = output $0 "\n";      output = output $0 "\n";
101    else if ($0 ~ /^@error\{\}/)    else if ($0 ~ /^@error\{\}/)
102      error = error $0 "\n";      error = error $0 "\n";
# Line 126  function new_test(input, status, output, Line 150  function new_test(input, status, output,
150    output = normalize(output);    output = normalize(output);
151    error = normalize(error);    error = normalize(error);
152    
153    printf ("AT_DATA([[in]],\n[[%s]])\n\n", input);    printf ("AT_DATA([[input.m4]],\n[[%s]])\n\n", input);
154    # Some of these tests `include' files from tests/.    # Some of these tests `include' files from tests/.
155    printf ("AT_CHECK_M4([[-I $srcdir in]], %s,", status);    printf ("AT_CHECK_M4([[input.m4]], %s,", status);
156    if (output)    if (output)
157      printf ("\n[[%s]]", output);      printf ("\n[[%s]]", output);
158    else    else
# Line 139  function new_test(input, status, output, Line 163  function new_test(input, status, output,
163      printf (")");      printf (")");
164    printf ("\n\n");    printf ("\n\n");
165  }  }
166    
167    function fatal(msg) {
168      print "generate.awk: " msg > "/dev/stderr"
169      exit 1
170    }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26