diff options
| author | Robert Collins <robertc@robertcollins.net> | 2006-04-14 23:38:55 +1000 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2006-04-14 23:38:55 +1000 |
| commit | 2ae3f76ff0c7dbadda0b3802dbc2b6baf867fb68 (patch) | |
| tree | c79f64f2b93eb2232c6f7c9b6e9bfdd5106a386a /shell | |
| parent | 71e63762cb62b0a1025b6087beda897417a3a8fc (diff) | |
| download | subunit-git-2ae3f76ff0c7dbadda0b3802dbc2b6baf867fb68.tar.gz | |
Start shell bindings.
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/Makefile | 7 | ||||
| -rw-r--r-- | shell/README | 27 | ||||
| -rw-r--r-- | shell/share/subunit.sh | 20 | ||||
| -rw-r--r-- | shell/test_shell.py | 53 | ||||
| -rwxr-xr-x | shell/tests/test_source_library.sh | 29 |
5 files changed, 136 insertions, 0 deletions
diff --git a/shell/Makefile b/shell/Makefile new file mode 100644 index 0000000..92b2a01 --- /dev/null +++ b/shell/Makefile @@ -0,0 +1,7 @@ +all: + +check: + # check the core python bindings. + python ./test_shell.py $(TESTRULE) + +.PHONY: all check diff --git a/shell/README b/shell/README new file mode 100644 index 0000000..38ffb4e --- /dev/null +++ b/shell/README @@ -0,0 +1,27 @@ +# +# subunit shell bindings. +# Copyright (C) 2006 Robert Collins <robertc@robertcollins.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +This tree contains shell bindings to the subunit protocol. They are written +entirely in shell, and unit tested in shell. See the tests/ directory for the +test scripts. You can use `make check` to run the tests. There is a trivial +python test_shell.py which uses the pyunit gui to expose the test results in a +compact form. + + + diff --git a/shell/share/subunit.sh b/shell/share/subunit.sh new file mode 100644 index 0000000..f0f21d8 --- /dev/null +++ b/shell/share/subunit.sh @@ -0,0 +1,20 @@ +# +# subunit.sh: shell functions to report test status via the subunit protocol. +# Copyright (C) 2006 Robert Collins <robertc@robertcollins.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + + diff --git a/shell/test_shell.py b/shell/test_shell.py new file mode 100644 index 0000000..ddba251 --- /dev/null +++ b/shell/test_shell.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# -*- Mode: python -*- +# +# Copyright (C) 2004 Canonical.com +# Author: Robert Collins <robert.collins@canonical.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +import unittest +from subunit.tests.TestUtil import TestVisitor, TestSuite +import subunit +import sys +import os +import shutil +import logging + + +class ShellTests(subunit.ExecTestCase): + + def test_shell(self): + """./tests/test_source_library.sh""" + + +def test_suite(): + result = TestSuite() + result.addTest(ShellTests('test_shell')) + return result + + + +def main(argv): + # TODO: We should find some standard way of giving tests-to-run to + # child processes. + runner = unittest.TextTestRunner(verbosity=2) + if not runner.run(test_suite()).wasSuccessful(): + return 1 + return 0 + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/shell/tests/test_source_library.sh b/shell/tests/test_source_library.sh new file mode 100755 index 0000000..fdc5f5c --- /dev/null +++ b/shell/tests/test_source_library.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# subunit shell bindings. +# Copyright (C) 2006 Robert Collins <robertc@robertcollins.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + + +# this script tests that we can source the subunit shell bindings successfully. +# It manually implements the control protocol so that it des not depend on the +# bindings being complete yet. + +# we expect to be run from the 'shell' tree root. + +echo 'test: shell bindings can be sourced' +. share/subunit.sh +echo 'success: shell bindings can be sourced' |
