OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |