Skip to content

Commit f57b41b

Browse files
committed
macos monl trace
1 parent fff90bf commit f57b41b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

trantor/unittests/HashUnittest.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
using namespace trantor;
88
using namespace trantor::utils;
99

10+
#ifdef __APPLE__
11+
#include <execinfo.h>
12+
#endif
13+
1014
TEST(Hash, MD5)
1115
{
1216
EXPECT_EQ(toHexString(md5("hello")), "5D41402ABC4B2A76B9719D911017C592");
@@ -53,6 +57,15 @@ TEST(Hash, BLAKE2b)
5357

5458
int main(int argc, char **argv)
5559
{
60+
#ifdef __APPLE__
61+
signal(SIGILL, [](int) {
62+
void *array[128];
63+
size_t size;
64+
size = backtrace(array, 128);
65+
backtrace_symbols_fd(array, size, STDERR_FILENO);
66+
exit(-1);
67+
});
68+
#endif
5669
testing::InitGoogleTest(&argc, argv);
5770
return RUN_ALL_TESTS();
5871
}

0 commit comments

Comments
 (0)