2 Test some ARM instruction emulation.
7 from lldbsuite
.test
.decorators
import *
8 from lldbsuite
.test
.lldbtest
import *
9 from lldbsuite
.test
import lldbutil
12 class ARMEmulationTestCase(TestBase
):
14 def test_thumb_emulations(self
):
15 test_dir
= os
.path
.join(self
.getSourceDir(), "new-test-files")
16 files
= os
.listdir(test_dir
)
19 if f
.endswith("-thumb.dat"):
23 test_file
= os
.path
.join(test_dir
, f
)
24 self
.run_a_single_test(test_file
)
27 def test_arm_emulations(self
):
28 test_dir
= os
.path
.join(self
.getSourceDir(), "new-test-files")
29 files
= os
.listdir(test_dir
)
32 if f
.endswith("-arm.dat"):
36 test_file
= os
.path
.join(test_dir
, f
)
37 self
.run_a_single_test(test_file
)
39 def run_a_single_test(self
, filename
):
40 insn
= lldb
.SBInstruction()
41 stream
= lldb
.SBStream()
42 success
= insn
.TestEmulation(stream
, filename
)
43 output
= stream
.GetData()
45 print("\nRunning test " + os
.path
.basename(filename
))
48 self
.assertTrue(success
, "Emulation test {} failed.".format(filename
))