summaryrefslogtreecommitdiffstats
path: root/lldb/unittests
diff options
context:
space:
mode:
authorStella Stamenova <stilis@microsoft.com>2018-05-14 21:04:24 +0000
committerStella Stamenova <stilis@microsoft.com>2018-05-14 21:04:24 +0000
commitad9b69789837c01a8372babf59367019c06b9c27 (patch)
tree43fe1685dace6fb2454876bc89efad94ac38ef45 /lldb/unittests
parent44e180ba895772086b5070c8b8f037ed8f45dcc1 (diff)
downloadbcm5719-llvm-ad9b69789837c01a8372babf59367019c06b9c27.tar.gz
bcm5719-llvm-ad9b69789837c01a8372babf59367019c06b9c27.zip
[lit] Fix several tests that fail when using Python 3 or on Windows
Summary: 1) In logtest.cpp, the name of the file that is reported is not always capitalized, so split the comparison to validate the file (case insensitive) and function (case sensitive) separately 2) Update the gdb remote client tests to work with Python 3. In Python 3, socket sends/receives data as bytes rather than byte strings. This also updates the usage of .hex() - this is no longer available in Python 3, so use hexlify instead Reviewers: asmith, labath, zturner Reviewed By: labath Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46773 llvm-svn: 332293
Diffstat (limited to 'lldb/unittests')
-rw-r--r--lldb/unittests/Utility/LogTest.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/lldb/unittests/Utility/LogTest.cpp b/lldb/unittests/Utility/LogTest.cpp
index 81fdce6efa3..e4e5002a7f8 100644
--- a/lldb/unittests/Utility/LogTest.cpp
+++ b/lldb/unittests/Utility/LogTest.cpp
@@ -225,12 +225,17 @@ TEST_F(LogChannelEnabledTest, log_options) {
EXPECT_EQ(1, sscanf(Msg.str().c_str(), "%d Hello World", &seq_no));
}
- EXPECT_TRUE(EnableChannel(getStream(), LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION,
- "chan", {}, Err));
- EXPECT_EQ(
- "LogTest.cpp:logAndTakeOutput Hello "
- "World\n",
- logAndTakeOutput("Hello World"));
+ {
+ EXPECT_TRUE(EnableChannel(getStream(), LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION,
+ "chan", {}, Err));
+ llvm::StringRef Msg = logAndTakeOutput("Hello World");
+ char File[12];
+ char Function[17];
+
+ sscanf(Msg.str().c_str(), "%[^:]:%s Hello World", File, Function);
+ EXPECT_STRCASEEQ("LogTest.cpp", File);
+ EXPECT_STREQ("logAndTakeOutput", Function);
+ }
EXPECT_TRUE(EnableChannel(
getStream(), LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD, "chan", {}, Err));
OpenPOWER on IntegriCloud