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

Side by Side Diff: tools/testrunner/local/testsuite.py

Issue 1466303005: [test-runner] Make test suite loading more robust. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 class TestSuite(object): 88 class TestSuite(object):
89 89
90 @staticmethod 90 @staticmethod
91 def LoadTestSuite(root): 91 def LoadTestSuite(root):
92 name = root.split(os.path.sep)[-1] 92 name = root.split(os.path.sep)[-1]
93 f = None 93 f = None
94 try: 94 try:
95 (f, pathname, description) = imp.find_module("testcfg", [root]) 95 (f, pathname, description) = imp.find_module("testcfg", [root])
96 module = imp.load_module("testcfg", f, pathname, description) 96 module = imp.load_module("testcfg", f, pathname, description)
97 return module.GetSuite(name, root) 97 return module.GetSuite(name, root)
98 except: 98 except ImportError:
Michael Achenbach 2015/11/25 10:06:58 This caught other errors, but import errors (e.g.
99 # Use default if no testcfg is present. 99 # Use default if no testcfg is present.
100 return GoogleTestSuite(name, root) 100 return GoogleTestSuite(name, root)
101 finally: 101 finally:
102 if f: 102 if f:
103 f.close() 103 f.close()
104 104
105 def __init__(self, name, root): 105 def __init__(self, name, root):
106 self.name = name # string 106 self.name = name # string
107 self.root = root # string containing path 107 self.root = root # string containing path
108 self.tests = None # list of TestCase objects 108 self.tests = None # list of TestCase objects
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 return (testcase.flags + ["--gtest_filter=" + testcase.path] + 332 return (testcase.flags + ["--gtest_filter=" + testcase.path] +
333 ["--gtest_random_seed=%s" % context.random_seed] + 333 ["--gtest_random_seed=%s" % context.random_seed] +
334 ["--gtest_print_time=0"] + 334 ["--gtest_print_time=0"] +
335 context.mode_flags) 335 context.mode_flags)
336 336
337 def _VariantGeneratorFactory(self): 337 def _VariantGeneratorFactory(self):
338 return StandardVariantGenerator 338 return StandardVariantGenerator
339 339
340 def shell(self): 340 def shell(self):
341 return self.name 341 return self.name
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698