55 строки
1.4 KiB
Python
55 строки
1.4 KiB
Python
import urllib2
|
|
import re
|
|
import urllib
|
|
import tarfile
|
|
import subprocess
|
|
import engine
|
|
import sys
|
|
from optparse import OptionParser
|
|
from benchmark import Benchmarks
|
|
|
|
sys.path.insert(1, '../driver')
|
|
import submitter
|
|
import utils
|
|
|
|
parser = OptionParser(usage="usage: %prog [options]")
|
|
parser.add_option("-f", "--force", dest="force", action="store_true", default=False,
|
|
help="Force runs even without source changes")
|
|
parser.add_option("-n", "--no-update", dest="noupdate", action="store_true", default=False,
|
|
help="Skip updating source repositories")
|
|
parser.add_option("-c", "--config", dest="config_name", type="string", default="awfy.config",
|
|
help="Config file (default: awfy.config)")
|
|
|
|
(options, args) = parser.parse_args()
|
|
|
|
utils.InitConfig(options.config_name)
|
|
|
|
KnownEngines = [engine.Mozilla(), engine.Chrome()]
|
|
NumUpdated = 0
|
|
|
|
# Update All engines
|
|
for e in KnownEngines:
|
|
e.update()
|
|
if e.updated:
|
|
NumUpdated += 1
|
|
|
|
# No updates. Report to server and wait 60 seconds, before moving on
|
|
submit = submitter.Submitter()
|
|
if NumUpdated == 0 and not options.force:
|
|
submit.Awake();
|
|
time.sleep(60)
|
|
sys.exit(0)
|
|
|
|
# Report all engines
|
|
submit.Start()
|
|
for e in KnownEngines:
|
|
for modeInfo in e.modes:
|
|
submit.AddEngine(modeInfo["name"], e.cset)
|
|
|
|
# Run all benches
|
|
for benchmark in Benchmarks:
|
|
for e in KnownEngines:
|
|
benchmark.run(e, submit)
|
|
|
|
submit.Finish(1)
|