Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
b4d0fc35
Unverified
Commit
b4d0fc35
authored
Apr 23, 2018
by
Zhangyi Chen
Committed by
GitHub
Apr 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #305 from zyearn/master
print bt when core dump happens in running UT
parents
7e56808e
17feeae9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
.travis.yml
.travis.yml
+0
-4
butil_unittest_main.cpp
test/butil_unittest_main.cpp
+1
-3
run_tests.sh
test/run_tests.sh
+8
-0
No files found.
.travis.yml
View file @
b4d0fc35
...
...
@@ -14,10 +14,6 @@ env:
before_script
:
-
ulimit -c unlimited -S
# enable core dumps
after_failure
:
-
COREFILE=$(find . -maxdepth 2 -name "core*" | head -n 1)
# find core file
-
if [[ -f "$COREFILE" ]]; then gdb -c "$COREFILE" example -ex "thread apply all bt" -ex "set pagination 0" -batch; fi
before_install
:
-
wget --no-clobber https://github.com/bazelbuild/bazel/releases/download/0.8.1/bazel_0.8.1-linux-x86_64.deb
-
sudo dpkg -i bazel_0.8.1-linux-x86_64.deb
...
...
test/butil_unittest_main.cpp
View file @
b4d0fc35
...
...
@@ -7,9 +7,7 @@
#include "butil/logging.h"
#include "multiprocess_func_list.h"
// Disable coredumps by default to avoid generating a lot of coredumps
// after running death tests.
DEFINE_bool
(
disable_coredump
,
true
,
"Never core dump"
);
DEFINE_bool
(
disable_coredump
,
false
,
"Never core dump"
);
int
main
(
int
argc
,
char
**
argv
)
{
butil
::
AtExitManager
at_exit
;
...
...
test/run_tests.sh
View file @
b4d0fc35
...
...
@@ -17,11 +17,19 @@ if [ $test_num -eq 0 ]; then
>
&2
echo
"[runtest] Cannot find any tests"
exit
1
fi
print_bt
()
{
COREFILE
=
$(
find
.
-maxdepth
2
-name
"core*"
|
head
-n
1
)
# find core file
if
[[
-f
"
$COREFILE
"
]]
;
then
gdb
-c
"
$COREFILE
"
$1
-ex
"thread apply all bt"
-ex
"set pagination 0"
-batch
;
fi
}
if
[
-z
"
$failed_test
"
]
;
then
>
&2
echo
"[runtest]
$test_num
succeeded"
elif
[
$test_num
-gt
1
]
;
then
print_bt
$failed_test
>
&2
echo
"[runtest] '
$failed_test
' failed,
$((
test_num-1
))
succeeded"
else
print_bt
$failed_test
>
&2
echo
"[runtest] '
$failed_test
' failed"
fi
exit
$rc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment