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    @no_debug_info_test
13*d4b08ccbSRaphael Isemann    @skipUnlessDarwin
14*d4b08ccbSRaphael Isemann    @skipIfOutOfTreeDebugserver
15*d4b08ccbSRaphael Isemann    def test_abort(self):
16*d4b08ccbSRaphael Isemann        self.build()
17*d4b08ccbSRaphael Isemann        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
18*d4b08ccbSRaphael Isemann        process = target.LaunchSimple(None, None, None)
19*d4b08ccbSRaphael Isemann        # Continue until process is terminated.
20*d4b08ccbSRaphael Isemann        process.Continue()
21*d4b08ccbSRaphael Isemann        # Test for the abort signal code.
22*d4b08ccbSRaphael Isemann        self.assertEqual(process.GetExitStatus(), 6)
23*d4b08ccbSRaphael Isemann        # Test for the exit code description.
24*d4b08ccbSRaphael Isemann        self.assertEqual(process.GetExitDescription(),
25*d4b08ccbSRaphael Isemann                         "Terminated due to signal 6")
26