~bill-huey/+junk/jtreg_results

« back to all changes in this revision

Viewing changes to get_jtreg_diffs.rb

  • Committer: Bill Huey
  • Date: 2014-10-16 05:16:37 UTC
  • Revision ID: billh@gnuppy-20141016051637-o17gzbv7chrmbecw
Changes for ruby scripts to use hashes to track test result states

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/ruby
 
2
# encoding: UTF-8
 
3
 
 
4
Encoding.default_external = Encoding::UTF_8
 
5
Encoding.default_internal = Encoding::UTF_8
 
6
 
 
7
#file="here"
 
8
#print ARGV[0]
 
9
#exit
 
10
#       hash.each {|key, val|
 
11
#               puts "#{val} ==> #{key}"
 
12
#       }
 
13
 
 
14
file=ARGV[0]
 
15
 
 
16
open_file=File.open(file)
 
17
out_file=NIL
 
18
 
 
19
hash=Hash.new
 
20
 
 
21
open_file.each_line do |line|
 
22
        match = line.match(/^(\+|-)(Error|Passed|FAILED):\s*(\w*)(\/(\w*))*(\/(\w*\.(java|sh)))/)
 
23
        if (match)
 
24
#               puts line
 
25
#               puts match[1], match[2], match[5], match[7]
 
26
                key = match[5] + "--" + match[7]
 
27
                val = match[1] + match[2]
 
28
 
 
29
#               puts key, val
 
30
                if (hash[key] && hash[key] != val)
 
31
                        puts "Was #{hash[key]}, #{val} ==> #{key}"
 
32
                end
 
33
 
 
34
                hash[key] = val
 
35
        end
 
36
end
 
37