Dmitry V. Levin | e837b14 | 2015-02-04 02:09:52 +0000 | [diff] [blame] | 1 | BEGIN { |
Dmitry V. Levin | 599819d | 2015-02-27 01:39:26 +0000 | [diff] [blame] | 2 | r[1] = "^select\\(2, \\[0 1\\], \\[0 1\\], \\[0 1\\], NULL\\) += 1 \\(\\)$" |
| 3 | r[2] = "^select\\(-1, NULL, 0x[0-9a-f]+, NULL, NULL\\) += -1 " |
| 4 | r[3] = "^select\\(1025, \\[0\\], \\[\\], NULL, \\{0, 100\\}\\) += 0 \\(Timeout\\)$" |
Dmitry V. Levin | e837b14 | 2015-02-04 02:09:52 +0000 | [diff] [blame] | 5 | r[4] = "^\\+\\+\\+ exited with 0 \\+\\+\\+$" |
| 6 | lines = 4 |
| 7 | fail = 0 |
| 8 | } |
| 9 | |
| 10 | NR > lines { exit 1 } |
| 11 | |
| 12 | { |
| 13 | if (match($0, r[NR])) |
| 14 | next |
| 15 | |
| 16 | print "Line " NR " does not match." |
| 17 | fail = 1 |
| 18 | } |
| 19 | |
| 20 | END { |
| 21 | if (fail == 0 && NR != lines) { |
| 22 | fail = 1 |
| 23 | print "Expected " lines " lines, found " NR " line(s)." |
| 24 | } |
| 25 | exit fail |
| 26 | } |