Summary: Moves lldbsuite tests to lldb/test/API.
This is a largely mechanical change, moved with the following steps:
```
rm lldb/test/API/testcases
mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}}
mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner
for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done
```
lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure.
Reviewers: labath, JDevlieghere
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71151
114 lines
4.3 KiB
Python
114 lines
4.3 KiB
Python
"""
|
|
Test that loading of dependents works correctly for all the potential
|
|
combinations.
|
|
"""
|
|
|
|
|
|
import lldb
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
|
|
@skipIfWindows # Windows deals differently with shared libs.
|
|
class TargetDependentsTestCase(TestBase):
|
|
|
|
mydir = TestBase.compute_mydir(__file__)
|
|
|
|
NO_DEBUG_INFO_TESTCASE = True
|
|
|
|
def setUp(self):
|
|
TestBase.setUp(self)
|
|
self.build()
|
|
|
|
def has_exactly_one_image(self, matching, msg=""):
|
|
self.expect(
|
|
"image list",
|
|
"image list should contain at least one image",
|
|
substrs=['[ 0]'])
|
|
should_match = not matching
|
|
self.expect(
|
|
"image list", msg, matching=should_match, substrs=['[ 1]'])
|
|
|
|
|
|
@expectedFailureAll(oslist=["linux"],
|
|
triple=no_match(".*-android"))
|
|
#linux does not support loading dependent files, but android does
|
|
@expectedFailureNetBSD
|
|
def test_dependents_implicit_default_exe(self):
|
|
"""Test default behavior"""
|
|
exe = self.getBuildArtifact("a.out")
|
|
self.runCmd("target create " + exe, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(False)
|
|
|
|
@expectedFailureAll(oslist=["linux"],
|
|
triple=no_match(".*-android"))
|
|
#linux does not support loading dependent files, but android does
|
|
@expectedFailureNetBSD
|
|
def test_dependents_explicit_default_exe(self):
|
|
"""Test default behavior"""
|
|
exe = self.getBuildArtifact("a.out")
|
|
self.runCmd("target create -ddefault " + exe, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(False)
|
|
|
|
def test_dependents_explicit_true_exe(self):
|
|
"""Test default behavior"""
|
|
exe = self.getBuildArtifact("a.out")
|
|
self.runCmd("target create -dtrue " + exe, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(True)
|
|
|
|
@expectedFailureAll(oslist=["linux"],
|
|
triple=no_match(".*-android"))
|
|
#linux does not support loading dependent files, but android does
|
|
@expectedFailureNetBSD
|
|
def test_dependents_explicit_false_exe(self):
|
|
"""Test default behavior"""
|
|
exe = self.getBuildArtifact("a.out")
|
|
self.runCmd("target create -dfalse " + exe, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(False)
|
|
|
|
def test_dependents_implicit_false_exe(self):
|
|
"""Test default behavior"""
|
|
exe = self.getBuildArtifact("a.out")
|
|
self.runCmd("target create -d " + exe, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(True)
|
|
|
|
@expectedFailureAndroid # android will return mutiple images
|
|
def test_dependents_implicit_default_lib(self):
|
|
ctx = self.platformContext
|
|
dylibName = ctx.shlib_prefix + 'load_a.' + ctx.shlib_extension
|
|
lib = self.getBuildArtifact(dylibName)
|
|
self.runCmd("target create " + lib, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(True)
|
|
|
|
def test_dependents_explicit_default_lib(self):
|
|
ctx = self.platformContext
|
|
dylibName = ctx.shlib_prefix + 'load_a.' + ctx.shlib_extension
|
|
lib = self.getBuildArtifact(dylibName)
|
|
self.runCmd("target create -ddefault " + lib, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(True)
|
|
|
|
def test_dependents_explicit_true_lib(self):
|
|
ctx = self.platformContext
|
|
dylibName = ctx.shlib_prefix + 'load_a.' + ctx.shlib_extension
|
|
lib = self.getBuildArtifact(dylibName)
|
|
self.runCmd("target create -dtrue " + lib, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(True)
|
|
|
|
@expectedFailureAll(oslist=["linux"],
|
|
triple=no_match(".*-android"))
|
|
#linux does not support loading dependent files, but android does
|
|
@expectedFailureNetBSD
|
|
def test_dependents_explicit_false_lib(self):
|
|
ctx = self.platformContext
|
|
dylibName = ctx.shlib_prefix + 'load_a.' + ctx.shlib_extension
|
|
lib = self.getBuildArtifact(dylibName)
|
|
self.runCmd("target create -dfalse " + lib, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(False)
|
|
|
|
def test_dependents_implicit_false_lib(self):
|
|
ctx = self.platformContext
|
|
dylibName = ctx.shlib_prefix + 'load_a.' + ctx.shlib_extension
|
|
lib = self.getBuildArtifact(dylibName)
|
|
self.runCmd("target create -d " + lib, CURRENT_EXECUTABLE_SET)
|
|
self.has_exactly_one_image(True)
|