Attempt to run python-stack_core_test

Test: presubmit
Bug: 185900237
Change-Id: I7c41545d4e1fbdeebd729615b5b12ee64ba6a8b9
This commit is contained in:
Julien Desprez
2021-04-20 14:31:19 -07:00
parent 4851047a4c
commit fd06c732e1
2 changed files with 25 additions and 7 deletions

View File

@@ -51,8 +51,23 @@ python_test_host {
"example_crashes.py", "example_crashes.py",
"stack_core.py", "stack_core.py",
], ],
data: [
":llvm-tools",
],
libs: ["python-symbol"], libs: ["python-symbol"],
test_suites: ["general-tests"], version: {
py2: {
enabled: false,
embedded_launcher: false,
},
py3: {
enabled: true,
embedded_launcher: false,
},
},
test_options: {
unit_test: true,
},
} }
python_test_host { python_test_host {

View File

@@ -24,6 +24,7 @@ import glob
import os import os
import platform import platform
import re import re
import shutil
import signal import signal
import subprocess import subprocess
import unittest import unittest
@@ -132,7 +133,9 @@ for sig in (signal.SIGABRT, signal.SIGINT, signal.SIGTERM):
def ToolPath(tool, toolchain=None): def ToolPath(tool, toolchain=None):
"""Return a fully-qualified path to the specified tool""" """Return a fully-qualified path to the specified tool, or just the tool if it's on PATH """
if shutil.which(tool) is not None:
return tool
if not toolchain: if not toolchain:
toolchain = FindToolchain() toolchain = FindToolchain()
return os.path.join(toolchain, tool) return os.path.join(toolchain, tool)
@@ -431,14 +434,14 @@ def CallCppFilt(mangled_symbol):
if mangled_symbol in _SYMBOL_DEMANGLING_CACHE: if mangled_symbol in _SYMBOL_DEMANGLING_CACHE:
return _SYMBOL_DEMANGLING_CACHE[mangled_symbol] return _SYMBOL_DEMANGLING_CACHE[mangled_symbol]
# TODO: Replace with llvm-cxxfilt when available.
global _CACHED_CXX_FILT global _CACHED_CXX_FILT
if not _CACHED_CXX_FILT: if not _CACHED_CXX_FILT:
os_name = platform.system().lower() toolchains = None
toolchains = glob.glob("%s/prebuilts/gcc/%s-*/host/*-linux-*/bin/*c++filt" % # TODO(b/187231324) do not hard-code prebuilt version number below
(ANDROID_BUILD_TOP, os_name)) if os.path.exists('./clang-r416183b/bin/llvm-cxxfilt'):
toolchains = ["./clang-r416183b/bin/llvm-cxxfilt"]
if not toolchains: if not toolchains:
raise Exception("Could not find gcc c++filt tool") raise Exception("Could not find llvm-cxxfilt tool")
_CACHED_CXX_FILT = sorted(toolchains)[-1] _CACHED_CXX_FILT = sorted(toolchains)[-1]
cmd = [_CACHED_CXX_FILT] cmd = [_CACHED_CXX_FILT]