summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-15 22:23:04 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-15 22:23:04 (EDT)
commit9553d14fd8f080af04deeb634ba6e67681740470 (patch)
tree40e013a4ef8a237cfc4e654137b3680fe26dbd26
parenta690164293994977d88fe59e4f7ab71eb209ff4b (diff)
tests/common.sh: Set EXIT trap
-rw-r--r--tests/common.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/common.sh b/tests/common.sh
index a523dee..cd90eb8 100644
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -17,6 +17,19 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+tests_es=0
+atexit()
+{
+ local es=${?}
+
+ if [ ${?} -ne 0 ]; then
+ exit ${?}
+ else
+ exit ${tests_es}
+ fi
+}
+trap atexit EXIT
+
in_place=true
builddir='.'
use()