equal
deleted
inserted
replaced
1 #!/usr/bin/ruby |
1 #!/usr/bin/ruby |
2 |
2 require 'rbconfig' |
3 require 'fileutils' |
3 require 'fileutils' |
4 |
4 |
5 PACKAGES = [ 'stx:libjava', 'stx:libjava/mauve', 'stx:libjava/experiments', 'stx:libjava/tools' ] |
5 PACKAGES = [ 'stx:libjava', 'stx:libjava/mauve', 'stx:libjava/experiments', 'stx:libjava/tools' ] |
6 PARAMS = { |
6 PARAMS = { |
7 'STX_LIBJAVA_ENABLE_JIT' => [ |
7 'STX_LIBJAVA_ENABLE_JIT' => [ |
12 'JDK6', |
12 'JDK6', |
13 'JDK7' |
13 'JDK7' |
14 ] |
14 ] |
15 } |
15 } |
16 |
16 |
17 REPORT_RUNNER = File.join(File.dirname(__FILE__), '..', '..', 'goodies', 'builder', 'reports' , 'report-runner.sh') |
|
18 REPORT_DIR="results-#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}" |
17 REPORT_DIR="results-#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}" |
|
18 |
|
19 |
|
20 def win32? |
|
21 return (Config::CONFIG['host_os'] =~ /mingw32/) != nil |
|
22 end |
|
23 |
|
24 def unix? |
|
25 if win32_wine? |
|
26 return false |
|
27 end |
|
28 return (Config::CONFIG['host_os'] =~ /linux|solaris/) != nil |
|
29 end |
|
30 |
|
31 if win32? |
|
32 REPORT_RUNNER = File.join(File.dirname(__FILE__), '..', '..', 'goodies', 'builder', 'reports' , 'report-runner.bat') |
|
33 else |
|
34 REPORT_RUNNER = File.join(File.dirname(__FILE__), '..', '..', 'goodies', 'builder', 'reports' , 'report-runner.sh') |
|
35 end |
|
36 |
|
37 |
19 |
38 |
20 def run_package(package, params = {}) |
39 def run_package(package, params = {}) |
21 ident = [] |
40 ident = [] |
22 setup = 'Stdin close' |
41 setup = 'Stdin close' |
23 params.keys.sort.each do | name | |
42 params.keys.sort.each do | name | |
35 ident = '' |
54 ident = '' |
36 cmd = %W[#{REPORT_RUNNER} -S #{setup} -D #{REPORT_DIR} -r Builder::TestReport -p #{package}] |
55 cmd = %W[#{REPORT_RUNNER} -S #{setup} -D #{REPORT_DIR} -r Builder::TestReport -p #{package}] |
37 end |
56 end |
38 |
57 |
39 puts "Running #{package} {#{ident}}" |
58 puts "Running #{package} {#{ident}}" |
|
59 puts cmd.inspect |
40 pattern = /SUMMARY: (?<run>\d+) run, (?<passed>\d+) passed, (?<skipped>\d+) skipped, (?<failed>\d+) failed, (?<error>\d+) error/ |
60 pattern = /SUMMARY: (?<run>\d+) run, (?<passed>\d+) passed, (?<skipped>\d+) skipped, (?<failed>\d+) failed, (?<error>\d+) error/ |
41 result = { |
61 result = { |
42 'run' => '?', |
62 'run' => '?', |
43 'passed' => '?', |
63 'passed' => '?', |
44 'skipped' => '?', |
64 'skipped' => '?', |
45 'failed' => '?', |
65 'failed' => '?', |
46 'error' => '?' |
66 'error' => '?' |
47 } |
67 } |
48 IO.popen(cmd + [ :err => [:child, :out]]) do | out | |
68 IO.popen(cmd + [ :err => [:child, :out]]) do | out | |
49 File.open(logf, "w") do | log | |
69 File.open(logf, "w") do | log | |
50 out.each do | line | |
70 out.each do | line | |
51 log.puts line |
71 log.puts line |
52 puts line |
72 puts line |