summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorcsharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-27 22:16:06 +0000
committercsharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-27 22:16:06 +0000
commit6727bb159c477cbbcf4307542fbb596280a4a4c3 (patch)
treee32187f6040ff13c16da29e81e3c8f57e1e0945b /tools
parentc102f8726ff7701bbbb3554c81a9f4df347779f2 (diff)
downloadchromium_src-6727bb159c477cbbcf4307542fbb596280a4a4c3.zip
chromium_src-6727bb159c477cbbcf4307542fbb596280a4a4c3.tar.gz
chromium_src-6727bb159c477cbbcf4307542fbb596280a4a4c3.tar.bz2
Get fix_test_cases.py to run on Windows
BUG= Review URL: https://chromiumcodereview.appspot.com/10876080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/isolate/fix_test_cases.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/isolate/fix_test_cases.py b/tools/isolate/fix_test_cases.py
index 057765a..5201afa 100755
--- a/tools/isolate/fix_test_cases.py
+++ b/tools/isolate/fix_test_cases.py
@@ -62,13 +62,10 @@ def run_all(result, shard_index, shard_count):
env['GTEST_SHARD_INDEX'] = str(shard_index)
env['GTEST_TOTAL_SHARDS'] = str(shard_count)
cmd = [sys.executable, 'isolate.py', 'run', '-r', result]
- return_code = subprocess.call(cmd, env=env)
+ subprocess.call(cmd, env=env)
if not os.path.isfile(result_file):
print >> sys.stderr, 'Failed to find %s' % result_file
return None
- if return_code:
- print >> sys.stderr, 'Failed to run isolate.py run'
- return None
with open(result_file) as f:
try:
data = json.load(f)
@@ -168,15 +165,18 @@ def fix_all(result, shard_index, shard_count):
def main():
parser = run_test_cases.OptionParserWithTestSharding(
usage='%prog <option> [test]')
+ parser.add_option('-d', '--dir', default='../../out/Release',
+ help='The directory containing the the test executable and '
+ 'result file. Defaults to %default')
options, args = parser.parse_args()
if len(args) != 1:
- parser.error('Use with the name of the test only, e.g. "unit_tests"')
+ parser.error('Use with the name of the test only, e.g. unit_tests')
basename = args[0]
- executable = '../../out/Release/%s' % basename
+ executable = os.path.join(options.dir, basename)
result = '%s.results' % executable
- if sys.platform == 'win32':
+ if sys.platform in('win32', 'cygwin'):
executable += '.exe'
if not os.path.isfile(executable):
print >> sys.stderr, (