Bug 637034 - Actually add test files.
authorMitchell Field <mitchell.field@live.com.au>
Wed, 23 Mar 2011 00:12:39 +1100
changeset 289 944fd46f8f787dd6b6b2b0a4002e754f0e8064e7
parent 288 562adc586a2460f0b45c003003cc97a8bc243ae5
child 290 6ba5ffef40fde03f71b4feb86f1616c77c0bd534
push id171
push usermitchell.field@live.com.au
push dateTue, 22 Mar 2011 13:16:59 +0000
bugs637034
Bug 637034 - Actually add test files.
tests/mkdir-fail.mk
tests/mkdir.mk
new file mode 100644
--- /dev/null
+++ b/tests/mkdir-fail.mk
@@ -0,0 +1,7 @@
+#T returncode: 1
+all:
+	mkdir newdir/subdir
+	test ! -d newdir/subdir
+	test ! -d newdir
+	rm -r newdir
+	@echo TEST-PASS
new file mode 100644
--- /dev/null
+++ b/tests/mkdir.mk
@@ -0,0 +1,27 @@
+MKDIR ?= mkdir
+
+all:
+	$(MKDIR) newdir
+	test -d newdir
+	# subdir, parent exists
+	$(MKDIR) newdir/subdir
+	test -d newdir/subdir
+	# -p, existing dir
+	$(MKDIR) -p newdir
+	# -p, existing subdir
+	$(MKDIR) -p newdir/subdir
+	# multiple subdirs, existing parent
+	$(MKDIR) newdir/subdir1 newdir/subdir2
+	test -d newdir/subdir1 -a -d newdir/subdir2
+	rm -r newdir
+	# -p, subdir, no existing parent
+	$(MKDIR) -p newdir/subdir
+	test -d newdir/subdir
+	rm -r newdir
+	# -p, multiple subdirs, no existing parent
+	$(MKDIR) -p newdir/subdir1 newdir/subdir2
+	test -d newdir/subdir1 -a -d newdir/subdir2
+	# -p, multiple existing subdirs
+	$(MKDIR) -p newdir/subdir1 newdir/subdir2
+	rm -r newdir
+	@echo TEST-PASS