Skip to content

[lldb] [lldb-dap] TestDap_runInTerminal is no longer ran when in release mode.  #108621

@da-viper

Description

@da-viper

There is currently a check to see if the release binary is larger than 1MiB, if this is the case then the test are run see

def test_runInTerminal(self):
if not self.isTestSupported():
return
"""

I built from main and the current size if 1.2m which causes the test to no run silently and becomes dead code.

The check.

def isTestSupported(self):
# For some strange reason, this test fails on python3.6
if not (sys.version_info.major == 3 and sys.version_info.minor >= 7):
return False
try:
# We skip this test for debug builds because it takes too long parsing lldb's own
# debug info. Release builds are fine.
# Checking the size of the lldb-dap binary seems to be a decent proxy for a quick
# detection. It should be far less than 1 MB in Release builds.
if os.path.getsize(os.environ["LLDBDAP_EXEC"]) < 1000000:
return True
except:
return False

(venv) ./build ➜   ls -nlh         
total 32M
-rwxr-xr-x. 1 1000 1000 664K Sep 13 18:47 lldb
-rwxr-xr-x. 1 1000 1000 139K Sep 10 16:24 lldb-argdumper
-rwxr-xr-x. 1 1000 1000 1.2M Sep 10 16:25 lldb-dap

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions