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

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

Issue 12659003: Cleanup test server instance after running each a test in gtest test runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Just cleanup test server instance Created 7 years, 9 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 | Annotate | Revision Log
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 8
9 from pylib import android_commands 9 from pylib import android_commands
10 from pylib import constants 10 from pylib import constants
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if android_commands.IsDeviceAttached(self.device): 264 if android_commands.IsDeviceAttached(self.device):
265 raise 265 raise
266 # Calculate unknown test results. 266 # Calculate unknown test results.
267 # TODO(frankf): Do not break TestResults encapsulation. 267 # TODO(frankf): Do not break TestResults encapsulation.
268 all_tests = set(test.split(':')) 268 all_tests = set(test.split(':'))
269 all_tests_ran = set([t.name for t in test_results.GetAll()]) 269 all_tests_ran = set([t.name for t in test_results.GetAll()])
270 unknown_tests = all_tests - all_tests_ran 270 unknown_tests = all_tests - all_tests_ran
271 test_results.unknown = [test_result.BaseTestResult(t, '') for t in 271 test_results.unknown = [test_result.BaseTestResult(t, '') for t in
272 unknown_tests] 272 unknown_tests]
273 retry = ':'.join([t.name for t in test_results.GetAllBroken()]) 273 retry = ':'.join([t.name for t in test_results.GetAllBroken()])
274 self.CleanupAfterEachTest()
craigdh 2013/03/08 19:53:08 Should this be in a finally block attached to the
nilesh 2013/03/08 23:37:52 Done.
274 return test_results, retry 275 return test_results, retry
275 276
276 #override 277 #override
277 def SetUp(self): 278 def SetUp(self):
278 """Sets up necessary test enviroment for the test suite.""" 279 """Sets up necessary test enviroment for the test suite."""
279 super(TestRunner, self).SetUp() 280 super(TestRunner, self).SetUp()
280 self.StripAndCopyFiles() 281 self.StripAndCopyFiles()
281 if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename): 282 if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename):
282 self.LaunchChromeTestServerSpawner() 283 self.LaunchChromeTestServerSpawner()
283 self.tool.SetupEnvironment() 284 self.tool.SetupEnvironment()
284 285
285 #override 286 #override
286 def TearDown(self): 287 def TearDown(self):
287 """Cleans up the test enviroment for the test suite.""" 288 """Cleans up the test enviroment for the test suite."""
288 self.tool.CleanUpEnvironment() 289 self.tool.CleanUpEnvironment()
289 if self._cleanup_test_files: 290 if self._cleanup_test_files:
290 self.adb.RemovePushedFiles() 291 self.adb.RemovePushedFiles()
291 super(TestRunner, self).TearDown() 292 super(TestRunner, self).TearDown()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698