aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2016-02-21 22:32:58 +0100
committerSebastian Pipping <sebastian@pipping.org>2016-02-21 22:47:53 +0100
commit0050b9afd963fddfab4035007770a0c9099fbaa0 (patch)
treee909a550fb0f300deadf889b7f117a74c6221498
parentBump version to 0.6.3 (diff)
downloadmetagen-0050b9afd963fddfab4035007770a0c9099fbaa0.tar.gz
metagen-0050b9afd963fddfab4035007770a0c9099fbaa0.tar.bz2
metagen-0050b9afd963fddfab4035007770a0c9099fbaa0.zip
Turn test_cli into a bit more of test suite
-rwxr-xr-xmetagen/test_cli39
1 files changed, 27 insertions, 12 deletions
diff --git a/metagen/test_cli b/metagen/test_cli
index 847ae07..d0c9792 100755
--- a/metagen/test_cli
+++ b/metagen/test_cli
@@ -1,28 +1,43 @@
#!/bin/bash
+handle_error() {
+ ret=$?
+ echo FAILED. >&2
+ exit ${ret}
+}
+trap handle_error ERR
+
+unset ECHANGELOG_USER
+PS4='# '
+set -x
+########################################
+# BEGIN tests
+########################################
+
#Should fail if ECHANGELOG_USER not set:
-echo 'metagen -m -Q'
-metagen -m -Q
+ECHANGELOG_USER='First Last <mail@example.org>' metagen -m -Q
+! metagen -m -Q
-echo 'metagen -e "someguy@gentoo.org" -d "Maint desc" -Q'
metagen -e "someguy@gentoo.org" -d "Maint desc" -Q
-echo 'metagen -e "someguy@gentoo.org" -n "Jon Doe" -d "Maint desc" -Q'
metagen -e "someguy@gentoo.org" -n "Jon Doe" -d "Maint desc" -Q
#Should fail if ECHANGELOG_USER not set:
-echo 'metagen -m -H python -e "foo@bar.com" -d "Foo bar.","Chow fun" -Q'
-metagen -m -H python -e "foo@bar.com" -d "Foo bar.","Chow fun" -Q
+ECHANGELOG_USER='First Last <mail@example.org>' metagen -m -H python -e "foo@bar.com" -d "Foo bar.","Chow fun" -Q
+! metagen -m -H python -e "foo@bar.com" -d "Foo bar.","Chow fun" -Q
#Should fail:
-echo 'metagen -Q'
-metagen -Q
+! metagen -Q
#Should fail:
-echo 'metagen -l "Long desc" -Q'
-metagen -l "Long desc" -Q
+! metagen -l "Long desc" -Q
#Should fail:
-echo 'metagen -d "Maintainer desc" -Q'
-metagen -d "Maintainer desc" -Q
+! metagen -d "Maintainer desc" -Q
+
+########################################
+# END tests
+########################################
+echo
+echo PASSED.