summaryrefslogtreecommitdiff
path: root/shell/tests/test_source_library.sh
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2006-04-15 00:25:55 +1000
committerRobert Collins <robertc@robertcollins.net>2006-04-15 00:25:55 +1000
commit3bebe681fc9c80ced4cfdda1b8624dd64074e83a (patch)
treee55e3a186572e33059d99a60e40ef3a88bb4387a /shell/tests/test_source_library.sh
parent2ae3f76ff0c7dbadda0b3802dbc2b6baf867fb68 (diff)
downloadsubunit-git-3bebe681fc9c80ced4cfdda1b8624dd64074e83a.tar.gz
Test the output of subunit_start_test.
Diffstat (limited to 'shell/tests/test_source_library.sh')
-rwxr-xr-xshell/tests/test_source_library.sh27
1 files changed, 26 insertions, 1 deletions
diff --git a/shell/tests/test_source_library.sh b/shell/tests/test_source_library.sh
index fdc5f5c..8fd10e6 100755
--- a/shell/tests/test_source_library.sh
+++ b/shell/tests/test_source_library.sh
@@ -25,5 +25,30 @@
# we expect to be run from the 'shell' tree root.
echo 'test: shell bindings can be sourced'
+# if any output occurs, this has failed to source cleanly
+source_output=$(. share/subunit.sh 2>&1)
+if [ $? == 0 -a "x$source_output" = "x" ]; then
+ echo 'success: shell bindings can be sourced'
+else
+ echo 'failure: shell bindings can be sourced ['
+ echo 'got an error code or output during sourcing.:'
+ echo $source_output
+ echo ']' ;
+fi
+
+# now source it for real
. share/subunit.sh
-echo 'success: shell bindings can be sourced'
+
+# we should have a test-start function
+echo 'test: subunit_start_test exists'
+found_type=$(type -t subunit_start_test)
+status=$?
+if [ $status == 0 -a "x$found_type" = "xfunction" ]; then
+ echo 'success: subunit_start_test exists'
+else
+ echo 'failure: subunit_start_test exists ['
+ echo 'subunit_start_test is not a function:'
+ echo "type -t status: $status"
+ echo "output: $found_type"
+ echo ']' ;
+fi