summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2014-12-17 17:51:04 -0500
committerColin Walters <walters@verbum.org>2014-12-17 17:51:04 -0500
commitd475b26f3eb4880e4a99511044360bfa5f61f435 (patch)
treed6c748f0cf4569d26e17b81e0a9b993772831154
parent12085b6e39c9b43ba50a6030e58b5a4380b41a48 (diff)
downloadlibgsystem-d475b26f3eb4880e4a99511044360bfa5f61f435.tar.gz
tap-test: Run each test in a clean temporary directory
This matches the https://wiki.gnome.org/GnomeGoals/InstalledTests spec.
-rwxr-xr-xbuildutil/tap-test12
1 files changed, 10 insertions, 2 deletions
diff --git a/buildutil/tap-test b/buildutil/tap-test
index 481e333..970b1c3 100755
--- a/buildutil/tap-test
+++ b/buildutil/tap-test
@@ -1,5 +1,13 @@
-#! /bin/sh
+#! /bin/bash
# run a GTest in tap mode. The test binary is passed as $1
-$1 -k --tap
+srcd=$(cd $(dirname $1) && pwd)
+bn=$(basename $1)
+tempdir=$(mktemp -d)
+function cleanup () {
+ rm "${tempdir}" -rf
+}
+trap cleanup EXIT
+cd ${tempdir}
+${srcd}/${bn} -k --tap