Add shell skip test support.
authorRobert Collins <robertc@robertcollins.net>
Sun, 6 Sep 2009 11:57:54 +0000 (21:57 +1000)
committerRobert Collins <robertc@robertcollins.net>
Sun, 6 Sep 2009 11:57:54 +0000 (21:57 +1000)
NEWS
shell/share/subunit.sh
shell/tests/test_source_library.sh

diff --git a/NEWS b/NEWS
index 30ca8e631d38e308a0dc5aeb0df1be76ce41f7f0..bb9bbf008555366cc3c8e5c2d3960b6be80214fd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,8 @@ subunit release notes
       stream to a single JUnit style XML stream using the pyjunitxml
       python library.
 
+    * The shell functions support skipping via ``subunit_skip_test`` now.
+
   BUG FIXES:
 
     * ``xfail`` outcomes are now passed to python TestResult's via
index e5735723e5bdc74a34dcc117072b592004272a7f..f63657a2b7b853a97460ac82c95ae3949a8cce96 100644 (file)
@@ -49,3 +49,11 @@ subunit_error_test () {
   cat -
   echo "]"
 }
+
+
+subunit_skip_test () {
+  # emit the current protocol test skipped marker for test $1
+  echo "skip: $1"
+}
+
+
index 81eef8358f299f6f85f5a1b209b76cabde74556e..be0cb187cf1bf706d15110e6416943d89904e271 100755 (executable)
@@ -94,3 +94,18 @@ else
   echo "output: $found_type"
   echo ']' ;
 fi
+
+# we should have a skip_test function
+echo 'test: subunit_skip_test exists'
+found_type=$(type -t subunit_skip_test)
+status=$?
+if [ $status == 0 -a "x$found_type" = "xfunction" ]; then
+  echo 'success: subunit_skip_test exists'
+else
+  echo 'failure: subunit_skip_test exists ['
+  echo 'subunit_skip_test is not a function:'
+  echo "type -t status: $status"
+  echo "output: $found_type"
+  echo ']' ;
+fi
+