Commit 45bf87b3 authored by Chip Turner's avatar Chip Turner Committed by Viswanath Sivakumar

Improve unit test output and logging to diagnose build breaks

Summary:
I can't repro the very frequent breakage we get from the unit
test framework, and it would be helpful to get the proper error messages
from it, so this adjusts the logging and changes a CHECK to an EXPECT to
get more data when the failure occurs.

Test Plan: runtests

Reviewed By: hans@fb.com

Subscribers: lins, anca, folly-diffs@

FB internal diff: D1761800

Tasks: 5870141

Signature: t1:1761800:1420226753:27a66fb0ce47cd57529e5fd0518550fb649c9eb5
parent 72e24ebc
......@@ -52,9 +52,9 @@ void verifyStackTraces() {
// Other than the top 2 frames (this one and getStackTrace /
// getStackTraceSafe), the stack traces should be identical
for (size_t i = 2; i < fa.frameCount; ++i) {
VLOG(1) << "i=" << i << " " << std::hex << fa.addresses[i] << " "
<< faSafe.addresses[i];
CHECK_EQ(fa.addresses[i], faSafe.addresses[i]);
LOG(INFO) << "i=" << i << " " << std::hex << "0x" << fa.addresses[i]
<< " 0x" << faSafe.addresses[i];
EXPECT_EQ(fa.addresses[i], faSafe.addresses[i]);
}
}
......@@ -85,11 +85,12 @@ TEST(StackTraceTest, Signal) {
sa.sa_flags = SA_RESETHAND | SA_SIGINFO;
CHECK_ERR(sigaction(SIGUSR1, &sa, nullptr));
raise(SIGUSR1);
CHECK(handled);
EXPECT_TRUE(handled);
}
int main(int argc, char *argv[]) {
testing::InitGoogleTest(&argc, argv);
gflags::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);
return RUN_ALL_TESTS();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment