blob: 6ece65b8e6fcb2943901e3faea9ac81fa674971a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/usr/bin/awk -f
BEGIN {
RS = "--\n"
FS = ":\n"
split(skip, skiparray, /,/)
for (i in skiparray)
skipdict[skiparray[i]]
}
function runtest(id, code, output,
failed)
{
if (id in skipdict)
return
print code > "script.sh"
print output > "output"
failed = 0
if (output == "ERR\n") {
if (system("sh script.sh > /dev/null 2>&1") == 0)
failed = 1
} else if (system("[ \"$(sh script.sh)\" = \"$(cat output)\" ]") != 0) {
failed = 1
}
if (failed)
printf("test %s in file '%s' failed (for cppawk = %s)\n",
id, FILENAME, ENVIRON["cppawk"])
close("script.sh")
close("output")
}
$1 {
runtest($1, $2, $3)
}
|