summaryrefslogtreecommitdiff
path: root/tests/libtest.sh
diff options
context:
space:
mode:
authorWilliam Manley <will@williammanley.net>2018-06-28 12:10:13 +0100
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-28 15:07:14 +0000
commitbab3b2bd4c45ae02c08dc0e43d38d3b542946bac (patch)
tree282b830cc38539bb3bc0e5b3626e979135f0f297 /tests/libtest.sh
parent05d8ade563d14633fb101412d78b70a9e94d3f33 (diff)
downloadostree-bab3b2bd4c45ae02c08dc0e43d38d3b542946bac.tar.gz
tests: Save corefiles back to tests/ directory if one exists
Makes it easier to debug failures from the tests. Closes: #1657 Approved by: cgwalters
Diffstat (limited to 'tests/libtest.sh')
-rwxr-xr-xtests/libtest.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/libtest.sh b/tests/libtest.sh
index f6b6eb2f..388408df 100755
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -34,6 +34,14 @@ else
fi
. ${test_srcdir}/libtest-core.sh
+save_core() {
+ if [ -e core ]; then
+ cp core "$test_srcdir/core"
+ fi
+}
+
+trap save_core EXIT;
+
test_tmpdir=$(pwd)
# Sanity check that we're in a tmpdir that has