1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

Revert "[sanitizer] Use COMPILER_RT_EMULATOR with gtests"

Missed review comments.

This reverts commit e25082961cb5aaafc817cb55593cf0ea8d3c4c22.
This commit is contained in:
Vitaly Buka 2021-04-22 11:15:23 -07:00
parent 555456c598
commit 639348c2c2

View File

@ -11,7 +11,7 @@ from .base import TestFormat
kIsWindows = sys.platform in ['win32', 'cygwin'] kIsWindows = sys.platform in ['win32', 'cygwin']
class GoogleTest(TestFormat): class GoogleTest(TestFormat):
def __init__(self, test_sub_dirs, test_suffix, run_under = []): def __init__(self, test_sub_dirs, test_suffix):
self.test_sub_dirs = str(test_sub_dirs).split(';') self.test_sub_dirs = str(test_sub_dirs).split(';')
# On Windows, assume tests will also end in '.exe'. # On Windows, assume tests will also end in '.exe'.
@ -21,7 +21,6 @@ class GoogleTest(TestFormat):
# Also check for .py files for testing purposes. # Also check for .py files for testing purposes.
self.test_suffixes = {exe_suffix, test_suffix + '.py'} self.test_suffixes = {exe_suffix, test_suffix + '.py'}
self.run_under = run_under
def getGTestTests(self, path, litConfig, localConfig): def getGTestTests(self, path, litConfig, localConfig):
"""getGTestTests(path) - [name] """getGTestTests(path) - [name]
@ -33,7 +32,7 @@ class GoogleTest(TestFormat):
litConfig: LitConfig instance litConfig: LitConfig instance
localConfig: TestingConfig instance""" localConfig: TestingConfig instance"""
list_test_cmd = self.prepareCmd([path, '--gtest_list_tests']) list_test_cmd = self.maybeAddPythonToCmd([path, '--gtest_list_tests'])
try: try:
output = subprocess.check_output(list_test_cmd, output = subprocess.check_output(list_test_cmd,
@ -114,7 +113,7 @@ class GoogleTest(TestFormat):
testName = namePrefix + '/' + testName testName = namePrefix + '/' + testName
cmd = [testPath, '--gtest_filter=' + testName] cmd = [testPath, '--gtest_filter=' + testName]
cmd = self.prepareCmd(cmd) cmd = self.maybeAddPythonToCmd(cmd)
if litConfig.useValgrind: if litConfig.useValgrind:
cmd = litConfig.valgrindArgs + cmd cmd = litConfig.valgrindArgs + cmd
@ -142,17 +141,13 @@ class GoogleTest(TestFormat):
return lit.Test.PASS,'' return lit.Test.PASS,''
def prepareCmd(self, cmd): def maybeAddPythonToCmd(self, cmd):
"""Insert interpreter if needed. """Insert the python exe into the command if cmd[0] ends in .py
It inserts the python exe into the command if cmd[0] ends in .py or caller
specified run_under.
We cannot rely on the system to interpret shebang lines for us on We cannot rely on the system to interpret shebang lines for us on
Windows, so add the python executable to the command if this is a .py Windows, so add the python executable to the command if this is a .py
script. script.
""" """
if cmd[0].endswith('.py'): if cmd[0].endswith('.py'):
cmd = [sys.executable] + cmd return [sys.executable] + cmd
if self.run_under:
cmd = self.run_under + cmd
return cmd return cmd