# HG changeset patch # User Jan Vrany # Date 1392136168 0 # Node ID e7c286435bfee5b8eab598e46dbea556d13b5570 # Parent c04668cd040d8be2d321f8e3f45f4fb562d12a34 Fixed tests'run-all.rb to run under Windows as well. diff -r c04668cd040d -r e7c286435bfe 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: (?\d+) run, (?\d+) passed, (?\d+) skipped, (?\d+) failed, (?\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 |