Title: [155216] trunk/Tools
Revision
155216
Author
[email protected]
Date
2013-09-06 15:04:38 -0700 (Fri, 06 Sep 2013)

Log Message

Fix run-jsc-stress-tests to run on bots with old Ruby.
        
Also make it create a repro file.

Rubber stamped by Mark Hahnenberg.

* Scripts/run-jsc-stress-tests:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (155215 => 155216)


--- trunk/Tools/ChangeLog	2013-09-06 21:58:38 UTC (rev 155215)
+++ trunk/Tools/ChangeLog	2013-09-06 22:04:38 UTC (rev 155216)
@@ -1,5 +1,15 @@
 2013-09-06  Filip Pizlo  <[email protected]>
 
+        Fix run-jsc-stress-tests to run on bots with old Ruby.
+        
+        Also make it create a repro file.
+
+        Rubber stamped by Mark Hahnenberg.
+
+        * Scripts/run-jsc-stress-tests:
+
+2013-09-06  Filip Pizlo  <[email protected]>
+
         Actually increment $numFailures
 
         Reviewed by Mark Hahnenberg.

Modified: trunk/Tools/Scripts/run-jsc-stress-tests (155215 => 155216)


--- trunk/Tools/Scripts/run-jsc-stress-tests	2013-09-06 21:58:38 UTC (rev 155215)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2013-09-06 22:04:38 UTC (rev 155216)
@@ -26,6 +26,13 @@
 require 'getoptlong'
 require 'pathname'
 
+begin
+    require 'shellwords'
+rescue => e
+    $stderr.puts "Warning: did not find shellwords; some features will be disabled."
+    $stderr.puts "Error: #{e.inspect}"
+end
+
 $jscPath = nil
 $collections = []
 $outputDir = Pathname.new("results")
@@ -62,8 +69,9 @@
 
 def run(kind, *options)
     name = "#{$benchmark}.#{kind}"
-    print "#{name}: "
-    if system($jscPath.to_s, *options, $benchmark)
+    print "#{$collectionName}/#{name}: "
+    arguments = [$jscPath.to_s] + options + [$benchmark]
+    if system(*arguments)
         puts "OK."
     else
         puts "FAIL: #{$?.inspect}"
@@ -72,6 +80,16 @@
             outp.puts name
         }
         $numFailures += 1
+        filename = $outputDir + $collectionName + name
+        begin
+            File.open(filename, "w") {
+                | outp |
+                outp.puts("cd #{Shellwords.shellescape(Dir.pwd)}")
+                outp.puts(arguments.map{|v| Shellwords.shellescape(v)}.join(' '))
+            }
+        rescue => e
+            $stderr.puts "Warning: failed to create repro file at #{filename}: #{e.inspect}"
+        end
     end
 end
 
@@ -107,6 +125,8 @@
     puts "Skipping #{$benchmark}"
 end
 
+collectionNames = {}
+
 Dir.mkdir($outputDir) unless $outputDir.directory?
 begin
     File.delete($outputDir + "failed")
@@ -118,6 +138,15 @@
 ARGV.each {
     | collection |
     $collection = collection
+    $collectionName = File.basename(collection)
+    toAdd = 1
+    while collectionNames[$collectionName]
+        $collectionName = File.basename(collection) + "-#{toAdd}"
+        toAdd += 1
+    end
+    collectionNames[$collectionName] = true
+    dir = $outputDir + $collectionName
+    Dir.mkdir(dir) unless dir.directory?
     Dir.chdir(collection) {
         Dir.foreach('.') {
             | benchmark |
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to