1 # Copyright 2014 the V8 project authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
8 from testrunner.local import commands
9 from testrunner.local import testsuite
10 from testrunner.local import utils
11 from testrunner.objects import testcase
14 class BaseUnitTestsSuite(testsuite.TestSuite):
15 def __init__(self, name, root):
16 super(BaseUnitTestsSuite, self).__init__(name, root)
18 def ListTests(self, context):
19 shell = os.path.abspath(os.path.join(context.shell_dir, self.shell()))
22 output = commands.Execute(context.command_prefix +
23 [shell, "--gtest_list_tests"] +
25 if output.exit_code != 0:
31 for test_desc in output.stdout.strip().split():
32 if test_desc.endswith('.'):
35 test = testcase.TestCase(self, test_case + test_desc, dependency=None)
40 def GetFlagsForTestCase(self, testcase, context):
41 return (testcase.flags + ["--gtest_filter=" + testcase.path] +
42 ["--gtest_random_seed=%s" % context.random_seed] +
43 ["--gtest_print_time=0"] +
47 return "base-unittests"
50 def GetSuite(name, root):
51 return BaseUnitTestsSuite(name, root)