From 4c56e5085795b583ffc43bdd6c4ec2cfa20b0d71 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Sun, 15 Jul 2018 00:43:11 -0400 Subject: [PATCH] tests: Show debug logfile when a test case fails --- test/common.bash | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/common.bash b/test/common.bash index f446477..edaf80f 100644 --- a/test/common.bash +++ b/test/common.bash @@ -1,8 +1,9 @@ setup() { - # Write a basic config file + + # Write a basic backupninja config file cat << EOF > "${BATS_TMPDIR}/backupninja.conf" when = manual -loglevel = 4 +loglevel = 5 reportemail = root reportsuccess = yes reportinfo = no @@ -24,6 +25,11 @@ EOF } teardown() { + + # Print the debug log in case the test case fails + echo "cat ${BATS_TMPDIR}/log/backupninja.log :" + cat "${BATS_TMPDIR}/log/backupninja.log" + # Clean up rm -rf "${BATS_TMPDIR}/backupninja.conf" \ "${BATS_TMPDIR}/log" \