Thread (2 messages) flat view 2 messages, 2 authors, 2016-07-06

Re: [PATCH] t7610 test for mktemp existence

From: Junio C Hamano <hidden>
Date: 2016-07-06 18:24:15

Armin Kunaschik [off-list ref] writes:
Subject: t7610: test for mktemp before test execution

mktemp is not available on all platforms, so the test
'temporary filenames are used with mergetool.writeToTemp'
fails there.
This patch does not replace mktemp but just disables
the test that otherwise would fail.
mergetool checks itself before executing mktemp and
reports an error.
Thanks.
quoted hunk
Signed-off-by: Armin Kunaschik <redacted>

---
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 76306cf..9279bf5 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -589,7 +589,12 @@ test_expect_success 'filenames seen by tools start with ./' '
 	git reset --hard master >/dev/null 2>&1
 '

-test_expect_success 'temporary filenames are used with mergetool.writeToTemp' '
+test_lazy_prereq MKTEMP '
+	tempdir=$(mktemp -d -t foo.XXX) &&
+	test -d "$tempdir"
+'
This makes me wonder what would happen to the leftover directory,
though.  Would it be a better idea to clean it up as well, i.e.

	tempdir=$(mktemp -d -t foo.XXXXXX) &&
	test -d "$tempdir" &&
        rmdir "$tempdir"
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help