2 Test some ARM instruction emulation.
5 from __future__ import print_function
11 from lldbsuite.test.lldbtest import *
13 class ARMEmulationTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
18 def test_thumb_emulations (self):
19 current_dir = os.getcwd();
20 test_dir = os.path.join (current_dir, "new-test-files")
21 files = os.listdir (test_dir)
25 thumb_files.append (f)
28 test_file = os.path.join (test_dir, f)
29 self.run_a_single_test (test_file)
32 def test_arm_emulations (self):
33 current_dir = os.getcwd();
34 test_dir = os.path.join (current_dir, "new-test-files")
35 files = os.listdir (test_dir)
42 test_file = os.path.join (test_dir, f)
43 self.run_a_single_test (test_file)
45 def run_a_single_test (self, filename):
46 insn = lldb.SBInstruction ();
47 stream = lldb.SBStream ();
48 success = insn.TestEmulation (stream, filename);
49 output = stream.GetData();
51 print('\nRunning test ' + os.path.basename(filename))
54 self.assertTrue (success, 'Emulation test succeeded.')