From c28d36b500c3c411d51f3d7d194f7cead6e4eea1 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Thu, 28 Apr 2016 14:06:45 -0700 Subject: [PATCH] Always run unit tests under gdb --- bin/ci/ubuntu/build-and-test.sh | 22 +++++++++++----------- bin/ci/ubuntu/unittests.gdb | 4 ---- 2 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 bin/ci/ubuntu/unittests.gdb diff --git a/bin/ci/ubuntu/build-and-test.sh b/bin/ci/ubuntu/build-and-test.sh index e3d8ea5a8d..3c74d9f790 100755 --- a/bin/ci/ubuntu/build-and-test.sh +++ b/bin/ci/ubuntu/build-and-test.sh @@ -20,20 +20,20 @@ rm -f build/rippled # See what we've actually built ldd $RIPPLED_PATH + +# Execute unit tests under gdb, printing a call stack +# if we get a crash. +gdb -return-child-result -quiet -batch \ + -ex "set env MALLOC_CHECK_=3" \ + -ex "set print thread-events off" \ + -ex run \ + -ex "thread apply all backtrace full" \ + -ex "quit" \ + --args $RIPPLED_PATH --unittest + if [[ $TARGET == "coverage" ]]; then - $RIPPLED_PATH --unittest # We pass along -p to keep path segments so as to avoid collisions codecov --gcov-args=-p --gcov-source-match='^src/(ripple|beast)' -else - if [[ $CC == "clang" ]]; then - # gdb segfaults with a clang build - $RIPPLED_PATH --unittest - else - # Run unittests (under gdb) - cat $__dirname/unittests.gdb | gdb \ - --return-child-result \ - --args $RIPPLED_PATH --unittest - fi fi # Run NPM tests diff --git a/bin/ci/ubuntu/unittests.gdb b/bin/ci/ubuntu/unittests.gdb deleted file mode 100644 index 189c1cca20..0000000000 --- a/bin/ci/ubuntu/unittests.gdb +++ /dev/null @@ -1,4 +0,0 @@ -set env MALLOC_CHECK_=3 -set print thread-events off -run -backtrace full