ef17fe7633
TEST=base-unittests BUG=v8:3489 LOG=y R=jochen@chromium.org, svenpanne@chromium.org Review URL: https://codereview.chromium.org/448603002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
# Copyright 2014 the V8 project authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import os
|
|
import shutil
|
|
|
|
from testrunner.local import commands
|
|
from testrunner.local import testsuite
|
|
from testrunner.local import utils
|
|
from testrunner.objects import testcase
|
|
|
|
|
|
class BaseUnitTestsSuite(testsuite.TestSuite):
|
|
def __init__(self, name, root):
|
|
super(BaseUnitTestsSuite, self).__init__(name, root)
|
|
|
|
def ListTests(self, context):
|
|
shell = os.path.abspath(os.path.join(context.shell_dir, self.shell()))
|
|
if utils.IsWindows():
|
|
shell += ".exe"
|
|
output = commands.Execute(context.command_prefix +
|
|
[shell, "--gtest_list_tests"] +
|
|
context.extra_flags)
|
|
if output.exit_code != 0:
|
|
print output.stdout
|
|
print output.stderr
|
|
return []
|
|
tests = []
|
|
test_case = ''
|
|
for test_desc in output.stdout.strip().split():
|
|
if test_desc.endswith('.'):
|
|
test_case = test_desc
|
|
else:
|
|
test = testcase.TestCase(self, test_case + test_desc, dependency=None)
|
|
tests.append(test)
|
|
tests.sort()
|
|
return tests
|
|
|
|
def GetFlagsForTestCase(self, testcase, context):
|
|
return (testcase.flags + ["--gtest_filter=" + testcase.path] +
|
|
["--gtest_random_seed=%s" % context.random_seed] +
|
|
["--gtest_print_time=0"] +
|
|
context.mode_flags)
|
|
|
|
def shell(self):
|
|
return "base-unittests"
|
|
|
|
|
|
def GetSuite(name, root):
|
|
return BaseUnitTestsSuite(name, root)
|