Commit Diff


commit - 554b91b15a7cc9f7b1e6946d04eb54a5dd2f2232
commit + 35dc45103a1b6a18ec34e90aa51109ec85ffbf2d
blob - fd892513440771d38a3b0d286f8840ebf69a8b61
blob + 8de81b92216ab58d015a08dc6dff1841fbff7939
--- regress/cmdline/Makefile
+++ regress/cmdline/Makefile
@@ -1,4 +1,4 @@
-REGRESS_TARGETS=checkout update
+REGRESS_TARGETS=checkout update status
 
 checkout:
 	./checkout.sh
@@ -6,4 +6,7 @@ checkout:
 update:
 	./update.sh
 
+status:
+	./status.sh
+
 .include <bsd.regress.mk>
blob - /dev/null
blob + 8de680cd25a36dc61a0b03b3ddcc44aafad31907 (mode 755)
--- /dev/null
+++ regress/cmdline/status.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+. ./common.sh
+
+function test_status_basic {
+	local testroot=`test_init status_basic`
+
+	got checkout $testroot/repo $testroot/wt > /dev/null
+	if [ "$?" != "0" ]; then
+		test_done "$testroot" "$?"
+		return 1
+	fi
+
+	echo "modified alpha" > $testroot/wt/alpha
+	echo "unversioned file" > $testroot/wt/foo
+	rm $testroot/wt/epsilon/zeta
+
+	echo 'M  alpha' > $testroot/stdout.expected
+	echo '!  epsilon/zeta' >> $testroot/stdout.expected
+	echo '?  foo' >> $testroot/stdout.expected
+
+	(cd $testroot/wt && got status > $testroot/stdout)
+
+	cmp $testroot/stdout.expected $testroot/stdout
+	if [ "$?" != "0" ]; then
+		diff -u $testroot/stdout.expected $testroot/stdout
+		test_done "$testroot" "$?"
+		return 1
+	fi
+
+	test_done "$testroot" "0"
+}
+
+run_test test_status_basic