From 63469c00c4accb522dd6d5a8a3e524304bcb559d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 12 Aug 2016 19:18:48 -0700 Subject: [PATCH] run-tests-on-robot.sh: Save coredump on crash. (#201) --- test-scripts/run-tests-on-robot.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test-scripts/run-tests-on-robot.sh b/test-scripts/run-tests-on-robot.sh index 5125f73937..5434449cce 100644 --- a/test-scripts/run-tests-on-robot.sh +++ b/test-scripts/run-tests-on-robot.sh @@ -180,4 +180,17 @@ elif [[ ${LANGUAGE} = cpp ]]; then fi printf "Running: %s\n\n" "${RUN_COMMAND}" +COREDUMP_DIR=${DEFAULT_DESTINATION_TEST_RESULTS_DIR}/coredump +mkdir -p ${COREDUMP_DIR} +CORE_LOCATION=${COREDUMP_DIR}/core +echo ${CORE_LOCATION} > /proc/sys/kernel/core_pattern +ulimit -c unlimited eval ${RUN_COMMAND} +if [[ $? -gt 127 && -e ${CORE_LOCATION} ]]; then + mv ${CORE_LOCATION} ${COREDUMP_DIR}/core.${LANGUAGE} + if [[ ${LANGUAGE} = java ]]; then + cp -p ${DEFAULT_JAVA_TEST_NAME} ${COREDUMP_DIR}/ + elif [[ ${LANGUAGE} = cpp ]]; then + cp -p ${DEFAULT_CPP_TEST_NAME} ${COREDUMP_DIR}/ + fi +fi