From 29872606d220420d53fde7cc5e3bea15f8da62e7 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Sun, 1 Sep 2019 09:12:37 +0000 Subject: [lldb] Restructure test folders to match LLDB command hierarchy Summary: As discussed on lldb-dev, this patch moves some LLDB tests into a hierarchy that more closely resembles the commands we use in the LLDB interpreter. This patch should only move tests that use the command interpreter and shouldn't touch any tests that primarily test the SB API. Reviewers: #lldb, jfb, JDevlieghere Reviewed By: #lldb, JDevlieghere Subscribers: dexonsmith, arphaman, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67033 llvm-svn: 370605 --- .../target/create-deps/TestTargetCreateDeps.py | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 lldb/packages/Python/lldbsuite/test/commands/target/create-deps/TestTargetCreateDeps.py (limited to 'lldb/packages/Python/lldbsuite/test/commands/target/create-deps/TestTargetCreateDeps.py') diff --git a/lldb/packages/Python/lldbsuite/test/commands/target/create-deps/TestTargetCreateDeps.py b/lldb/packages/Python/lldbsuite/test/commands/target/create-deps/TestTargetCreateDeps.py new file mode 100644 index 00000000000..2d96433b7d4 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/target/create-deps/TestTargetCreateDeps.py @@ -0,0 +1,114 @@ +""" +Test that loading of dependents works correctly for all the potential +combinations. +""" + +from __future__ import print_function + +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) -- cgit v1.2.3