summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/API/SBInstruction.cpp7
-rw-r--r--lldb/source/Core/Disassembler.cpp12
-rw-r--r--lldb/test/arm_emulation/TestEmulations.py8
3 files changed, 11 insertions, 16 deletions
diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp
index 4e5b4e2edc6..920ce3c60a6 100644
--- a/lldb/source/API/SBInstruction.cpp
+++ b/lldb/source/API/SBInstruction.cpp
@@ -155,8 +155,5 @@ SBInstruction::TestEmulation (lldb::SBStream &output_stream, const char *test_f
if (!m_opaque_sp.get())
m_opaque_sp.reset (new PseudoInstruction());
- bool success = m_opaque_sp->TestEmulation (output_stream.get(), test_file);
- if (output_stream.GetSize() > 0)
- fprintf (stdout, "%s", output_stream.GetData());
- return success;
-} \ No newline at end of file
+ return m_opaque_sp->TestEmulation (output_stream.get(), test_file);
+}
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 2db2d55308e..a8c807dd99a 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -510,14 +510,14 @@ Instruction::TestEmulation (Stream *out_stream, const char *file_name)
if (!file_name)
{
- out_stream->Printf ("Instruction::TestEmulation: Missing file_name.\n");
+ out_stream->Printf ("Instruction::TestEmulation: Missing file_name.");
return false;
}
FILE *test_file = fopen (file_name, "r");
if (!test_file)
{
- out_stream->Printf ("Instruction::TestEmulation: Attempt to open test file failed.\n");
+ out_stream->Printf ("Instruction::TestEmulation: Attempt to open test file failed.");
return false;
}
@@ -525,7 +525,7 @@ Instruction::TestEmulation (Stream *out_stream, const char *file_name)
char buffer[256];
if (!fgets (buffer,255, test_file)) // Read/skip first line of file, which should be a comment line (description).
{
- out_stream->Printf ("Instruction::TestEmulation: Read comment line failed.\n");
+ out_stream->Printf ("Instruction::TestEmulation: Read comment line failed.");
fclose (test_file);
return false;
}
@@ -533,7 +533,7 @@ Instruction::TestEmulation (Stream *out_stream, const char *file_name)
if (fscanf (test_file, "%s", buffer) != 1) // Read the arch or arch-triple from the file
{
- out_stream->Printf ("Instruction::TestEmulation: Read arch failed.\n");
+ out_stream->Printf ("Instruction::TestEmulation: Read arch failed.");
fclose (test_file);
return false;
}
@@ -549,9 +549,9 @@ Instruction::TestEmulation (Stream *out_stream, const char *file_name)
fclose (test_file);
if (success)
- out_stream->Printf ("Emulation test succeeded.\n");
+ out_stream->Printf ("Emulation test succeeded.");
else
- out_stream->Printf ("Emulation test failed.\n");
+ out_stream->Printf ("Emulation test failed.");
return success;
}
diff --git a/lldb/test/arm_emulation/TestEmulations.py b/lldb/test/arm_emulation/TestEmulations.py
index 3f2c6dd28ba..9b597c36b76 100644
--- a/lldb/test/arm_emulation/TestEmulations.py
+++ b/lldb/test/arm_emulation/TestEmulations.py
@@ -22,7 +22,6 @@ class ARMEmulationTestCase(TestBase):
for f in thumb_files:
test_file = os.path.join (test_dir, f)
- print '\nRunning test ' + f
self.run_a_single_test (test_file)
@@ -37,7 +36,6 @@ class ARMEmulationTestCase(TestBase):
for f in arm_files:
test_file = os.path.join (test_dir, f)
- print '\nRunning test ' + f
self.run_a_single_test (test_file)
def run_a_single_test (self, filename):
@@ -45,11 +43,11 @@ class ARMEmulationTestCase(TestBase):
stream = lldb.SBStream ();
success = insn.TestEmulation (stream, filename);
output = stream.GetData();
- if not success:
+ if self.TraceOn():
+ print '\nRunning test ' + os.path.basename(filename)
print output
- self.assertTrue ('Emulation test succeeded.' in output)
- self.assertTrue (success == True)
+ self.assertTrue (success, 'Emulation test succeeded.')
if __name__ == '__main__':
import atexit
OpenPOWER on IntegriCloud