xref: /llvm-project/lldb/test/API/macosx/debugserver-exit-code/TestDebugServerExitCode.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1d4b08ccbSRaphael Isemann"""
2d4b08ccbSRaphael IsemannTests the exit code/description coming from the debugserver.
3d4b08ccbSRaphael Isemann"""
4d4b08ccbSRaphael Isemann
5d4b08ccbSRaphael Isemannimport lldb
6d4b08ccbSRaphael Isemannfrom lldbsuite.test.decorators import *
7d4b08ccbSRaphael Isemannfrom lldbsuite.test.lldbtest import *
8d4b08ccbSRaphael Isemannfrom lldbsuite.test import lldbutil
9d4b08ccbSRaphael Isemann
10d4b08ccbSRaphael Isemann
11*2238dcc3SJonas Devlieghereclass TestCase(TestBase):
12d4b08ccbSRaphael Isemann    @no_debug_info_test
13d4b08ccbSRaphael Isemann    @skipUnlessDarwin
14d4b08ccbSRaphael Isemann    @skipIfOutOfTreeDebugserver
15d4b08ccbSRaphael Isemann    def test_abort(self):
16d4b08ccbSRaphael Isemann        self.build()
17d4b08ccbSRaphael Isemann        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
18d4b08ccbSRaphael Isemann        process = target.LaunchSimple(None, None, None)
19d4b08ccbSRaphael Isemann        # Continue until process is terminated.
20d4b08ccbSRaphael Isemann        process.Continue()
21d4b08ccbSRaphael Isemann        # Test for the abort signal code.
22d4b08ccbSRaphael Isemann        self.assertEqual(process.GetExitStatus(), 6)
23d4b08ccbSRaphael Isemann        # Test for the exit code description.
24*2238dcc3SJonas Devlieghere        self.assertEqual(process.GetExitDescription(), "Terminated due to signal 6")
25