Fixed tests'run-all.rb to run under Windows as well. development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 11 Feb 2014 16:29:28 +0000
branchdevelopment
changeset 3020 e7c286435bfe
parent 3019 c04668cd040d
child 3021 39a55d1baeff
Fixed tests'run-all.rb to run under Windows as well.
tests/run-all.rb
--- 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 |