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