summaryrefslogtreecommitdiffstats
path: root/unit-tests/mm/check_results
blob: a7b0975a590c5560a5e17db63dd48ecd2937286b (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
#!/usr/bin/env ruby1.9

require 'pp'

patterns = [
            /Invalid read of size 1/,
            /Invalid write of size 1/,
            /Invalid read of size 1/,
            /still reachable: [0-9,]+ bytes in 3 blocks/
           ]

lines = STDIN.readlines
pp lines

result = catch(:done) do
  patterns.each do |pat|
    loop do
      throw(:done, false) if lines.size == 0

      line = lines.shift
      if line =~ pat
        STDERR.puts "matched #{pat}"
        break;
      end
    end
  end

  throw(:done, true)
end

exit(result ? 0 : 1)