⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 271427 in webkit


Ignore:
Timestamp:
Jan 12, 2021, 8:17:31 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Implement serial tests for the ruby test writer
https://bugs.webkit.org/show_bug.cgi?id=220360

Patch by Angelos Oikonomopoulos <Angelos Oikonomopoulos> on 2021-01-12
Reviewed by Yusuke Suzuki.

This is a verbatim copy of the implementation in the default writer.

  • Scripts/webkitruby/jsc-stress-test-writer-ruby.rb:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r271426 r271427  
     12021-01-12  Angelos Oikonomopoulos  <angelos@igalia.com>
     2
     3        Implement serial tests for the ruby test writer
     4        https://bugs.webkit.org/show_bug.cgi?id=220360
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        This is a verbatim copy of the implementation in the default writer.
     9
     10        * Scripts/webkitruby/jsc-stress-test-writer-ruby.rb:
     11
    1122021-01-12  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
    213
  • trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-ruby.rb

    r264391 r271427  
    411411end
    412412
     413def output_target(outp, plan, prereqs)
     414    index = plan.index
     415    target = "test_done_#{index}"
     416    outp.puts "#{target}: #{prereqs.join(" ")}"
     417    outp.puts "\truby test_script_#{index}"
     418    target
     419end
     420
    413421def prepareMakeTestRunner(remoteIndex)
    414     runIndices = []
     422    serialPlans = {}
     423    $serialRunlist.each { |p| serialPlans[p] = nil }
     424    runPlans = []
     425    serialRunPlans = []
    415426    $runlist.each {
    416427        | plan |
    417428        if !$remote or plan.index % $remoteHosts.length == remoteIndex
    418             runIndices << plan.index
    419         end
    420     }
    421    
     429            if serialPlans.has_key?(plan)
     430                serialRunPlans << plan
     431            else
     432                runPlans << plan
     433            end
     434        end
     435    }
     436
    422437    File.open($runnerDir + "Makefile.#{remoteIndex}", "w") {
    423438        | outp |
    424         outp.puts("all: " + runIndices.map{|v| "test_done_#{v}"}.join(' '))
    425         runIndices.each {
    426             | index |
    427             plan = $runlist[index]
    428             outp.puts "test_done_#{index}:"
    429             outp.puts "\truby test_script_#{plan.index}"
    430         }
     439        if serialRunPlans.empty?
     440            outp.puts("all: parallel")
     441        else
     442            serialPrereq = "test_done_#{serialRunPlans[-1].index}"
     443            outp.puts("all: #{serialPrereq}")
     444            prev_target = "parallel"
     445            serialRunPlans.each {
     446                | plan |
     447                prev_target = output_target(outp, plan, [prev_target])
     448            }
     449        end
     450        parallelTargets = runPlans.collect {
     451            | plan |
     452            output_target(outp, plan, [])
     453        }
     454        outp.puts("parallel: " + parallelTargets.join(" "))
    431455    }
    432456end
Note: See TracChangeset for help on using the changeset viewer.