Fixed tests'run-all.rb to run under Windows as well.
--- a/tests/run-all.rb Fri Feb 07 09:49:00 2014 +0100
+++ b/tests/run-all.rb Tue Feb 11 16:29:28 2014 +0000
@@ -1,5 +1,5 @@
#!/usr/bin/ruby
-
+require 'rbconfig'
require 'fileutils'
PACKAGES = [ 'stx:libjava', 'stx:libjava/mauve', 'stx:libjava/experiments', 'stx:libjava/tools' ]
@@ -14,9 +14,28 @@
]
}
-REPORT_RUNNER = File.join(File.dirname(__FILE__), '..', '..', 'goodies', 'builder', 'reports' , 'report-runner.sh')
REPORT_DIR="results-#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}"
+
+def win32?
+ return (Config::CONFIG['host_os'] =~ /mingw32/) != nil
+end
+
+def unix?
+ if win32_wine?
+ return false
+ end
+ return (Config::CONFIG['host_os'] =~ /linux|solaris/) != nil
+end
+
+if win32?
+ REPORT_RUNNER = File.join(File.dirname(__FILE__), '..', '..', 'goodies', 'builder', 'reports' , 'report-runner.bat')
+else
+ REPORT_RUNNER = File.join(File.dirname(__FILE__), '..', '..', 'goodies', 'builder', 'reports' , 'report-runner.sh')
+end
+
+
+
def run_package(package, params = {})
ident = []
setup = 'Stdin close'
@@ -37,6 +56,7 @@
end
puts "Running #{package} {#{ident}}"
+ puts cmd.inspect
pattern = /SUMMARY: (?<run>\d+) run, (?<passed>\d+) passed, (?<skipped>\d+) skipped, (?<failed>\d+) failed, (?<error>\d+) error/
result = {
'run' => '?',
@@ -44,7 +64,7 @@
'skipped' => '?',
'failed' => '?',
'error' => '?'
- }
+ }
IO.popen(cmd + [ :err => [:child, :out]]) do | out |
File.open(logf, "w") do | log |
out.each do | line |