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; |
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"; |
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 |
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 |
|
} |