aboutsummaryrefslogtreecommitdiff
path: root/t/tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/tests.sh')
-rw-r--r--t/tests.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/tests.sh b/t/tests.sh
index a0d32e2..2eb0e00 100644
--- a/t/tests.sh
+++ b/t/tests.sh
@@ -15,8 +15,14 @@
set -e
+# From g.sh
+__g_realpath() {
+ [ -d "$1" ] && echo "$(cd "$1" && pwd)" || echo "$(cd "$(dirname "$1")"
+ && pwd)/$(basename "$1")"
+}
+
# Cleanup previous tests and setup some special variables.
-d="$(realpath $(dirname $0))"
+d="$(__g_realpath $(dirname $0))"
rm -f $d/output.txt
HOME="$d"