Index: tools/test-wrapper-gypbuild.py |
diff --git a/tools/test-wrapper-gypbuild.py b/tools/test-wrapper-gypbuild.py |
index fda4105a985f11b4bad4d26991d982f8c6de5fa3..eda24591732ce14f3b93bc628d57a851a6989d96 100755 |
--- a/tools/test-wrapper-gypbuild.py |
+++ b/tools/test-wrapper-gypbuild.py |
@@ -1,6 +1,6 @@ |
#!/usr/bin/env python |
# |
-# Copyright 2011 the V8 project authors. All rights reserved. |
+# Copyright 2012 the V8 project authors. All rights reserved. |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions are |
# met: |
@@ -56,6 +56,9 @@ def BuildOptions(): |
result.add_option("--no-presubmit", |
help='Skip presubmit checks', |
default=False, action="store_true") |
+ result.add_option("--buildbot", |
+ help='Adapt to path structure used on buildbots', |
+ default=False, action="store_true") |
# Flags this wrapper script handles itself: |
result.add_option("-m", "--mode", |
@@ -144,14 +147,16 @@ def ProcessOptions(options): |
options.mode = options.mode.split(',') |
options.arch = options.arch.split(',') |
for mode in options.mode: |
- if not mode in ['debug', 'release']: |
+ if not mode.lower() in ['debug', 'release']: |
print "Unknown mode %s" % mode |
return False |
for arch in options.arch: |
if not arch in ['ia32', 'x64', 'arm', 'mips']: |
print "Unknown architecture %s" % arch |
return False |
- |
+ if options.buildbot: |
+ # Buildbots run presubmit tests as a separate step. |
+ options.no_presubmit = True |
return True |
@@ -213,22 +218,26 @@ def Main(): |
return 1 |
workspace = abspath(join(dirname(sys.argv[0]), '..')) |
+ returncodes = 0 |
if not options.no_presubmit: |
print ">>> running presubmit tests" |
- subprocess.call([workspace + '/tools/presubmit.py']) |
+ returncodes += subprocess.call([workspace + '/tools/presubmit.py']) |
args_for_children = [workspace + '/tools/test.py'] + PassOnOptions(options) |
args_for_children += ['--no-build', '--build-system=gyp'] |
for arg in args: |
args_for_children += [arg] |
- returncodes = 0 |
env = os.environ |
for mode in options.mode: |
for arch in options.arch: |
print ">>> running tests for %s.%s" % (arch, mode) |
- shellpath = workspace + '/' + options.outdir + '/' + arch + '.' + mode |
+ if options.buildbot: |
+ shellpath = workspace + '/' + options.outdir + '/' + mode |
+ mode = mode.lower() |
+ else: |
+ shellpath = workspace + '/' + options.outdir + '/' + arch + '.' + mode |
env['LD_LIBRARY_PATH'] = shellpath + '/lib.target' |
shell = shellpath + "/d8" |
child = subprocess.Popen(' '.join(args_for_children + |