]> arthur.barton.de Git - bup.git/commitdiff
Add trivial test-main.sh
authorRob Browning <rlb@defaultvalue.org>
Sat, 9 Jan 2016 21:42:35 +0000 (15:42 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 9 Jan 2016 21:43:01 +0000 (15:43 -0600)
For now, just test that "bup" exits with the specified 99, which also
exercises the usage() code (so we at least notice missing imports,
etc.).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Makefile
t/test-main.sh [new file with mode: 0755]

index ab52afd1e3c087824ff59e09a2723c08592a7d05..e4590e5b0c228d7c33eed11160d78c9667be9922 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -145,6 +145,7 @@ runtests-python: all t/tmp
            | tee -a t/tmp/test-log/$$$$.log
 
 cmdline_tests := \
+  t/test-main.sh \
   t/test-index.sh \
   t/test-split-join.sh \
   t/test-fuse.sh \
diff --git a/t/test-main.sh b/t/test-main.sh
new file mode 100755 (executable)
index 0000000..81c536b
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+. wvtest-bup.sh || exit $?
+. t/lib.sh || exit $?
+
+set -o pipefail
+
+TOP="$(WVPASS pwd)" || exit $?
+tmpdir="$(WVPASS wvmktempdir)" || exit $?
+export BUP_DIR="$tmpdir/bup"
+
+bup()
+{
+    "$TOP/bup" "$@"
+}
+
+WVSTART 'main'
+
+bup
+rc=$?
+WVPASSEQ "$rc" 99
+
+WVPASS rm -r "$tmpdir"