Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: build/android/pylib/gtest/test_runner.py

Issue 18323020: Updates the test runner script exit codes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks some docstrings, removes NORMAL_EXIT_CODE Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import glob 5 import glob
6 import logging 6 import logging
7 import os 7 import os
8 import sys 8 import sys
9 9
10 from pylib import android_commands 10 from pylib import android_commands
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 #override 352 #override
353 def RunTest(self, test): 353 def RunTest(self, test):
354 test_results = base_test_result.TestRunResults() 354 test_results = base_test_result.TestRunResults()
355 if not test: 355 if not test:
356 return test_results, None 356 return test_results, None
357 357
358 try: 358 try:
359 self.test_package.ClearApplicationState() 359 self.test_package.ClearApplicationState()
360 self.test_package.CreateTestRunnerScript(test, self._test_arguments) 360 self.test_package.CreateTestRunnerScript(test, self._test_arguments)
361 test_results = self.test_package.RunTestsAndListResults() 361 test_results = self.test_package.RunTestsAndListResults()
362 except errors.DeviceUnresponsiveError as e:
363 # Make sure this device is not attached
364 logging.warning(e)
365 if android_commands.IsDeviceAttached(self.device):
366 raise
367 finally: 362 finally:
368 self.CleanupSpawningServerState() 363 self.CleanupSpawningServerState()
369 # Calculate unknown test results. 364 # Calculate unknown test results.
370 all_tests = set(test.split(':')) 365 all_tests = set(test.split(':'))
371 all_tests_ran = set([t.GetName() for t in test_results.GetAll()]) 366 all_tests_ran = set([t.GetName() for t in test_results.GetAll()])
372 unknown_tests = all_tests - all_tests_ran 367 unknown_tests = all_tests - all_tests_ran
373 test_results.AddResults( 368 test_results.AddResults(
374 [base_test_result.BaseTestResult(t, base_test_result.ResultType.UNKNOWN) 369 [base_test_result.BaseTestResult(t, base_test_result.ResultType.UNKNOWN)
375 for t in unknown_tests]) 370 for t in unknown_tests])
376 retry = ':'.join([t.GetName() for t in test_results.GetNotPass()]) 371 retry = ':'.join([t.GetName() for t in test_results.GetNotPass()])
377 return test_results, retry 372 return test_results, retry
378 373
379 #override 374 #override
380 def SetUp(self): 375 def SetUp(self):
381 """Sets up necessary test enviroment for the test suite.""" 376 """Sets up necessary test enviroment for the test suite."""
382 super(TestRunner, self).SetUp() 377 super(TestRunner, self).SetUp()
383 if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename): 378 if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename):
384 self.LaunchChromeTestServerSpawner() 379 self.LaunchChromeTestServerSpawner()
385 self.tool.SetupEnvironment() 380 self.tool.SetupEnvironment()
386 381
387 #override 382 #override
388 def TearDown(self): 383 def TearDown(self):
389 """Cleans up the test enviroment for the test suite.""" 384 """Cleans up the test enviroment for the test suite."""
390 self.tool.CleanUpEnvironment() 385 self.tool.CleanUpEnvironment()
391 if self._cleanup_test_files: 386 if self._cleanup_test_files:
392 self.adb.RemovePushedFiles() 387 self.adb.RemovePushedFiles()
393 super(TestRunner, self).TearDown() 388 super(TestRunner, self).TearDown()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698