Commit d6bceadd authored by Grégory Wisniewski's avatar Grégory Wisniewski

Add command selectors to tests runner.

Allow override the defaults to run unit, functional or both test suites.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1673 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5af243ef
......@@ -16,6 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import optparse
import unittest
import tempfile
import logging
......@@ -318,6 +319,16 @@ class NeoTestRunner(unittest.TestResult):
if __name__ == "__main__":
# handle command line options
parser = optparse.OptionParser()
parser.add_option('-f', '--functional', action='store_true')
parser.add_option('-u', '--unit', action='store_true')
(options, args) = parser.parse_args()
if options.functional or options.unit:
# override defaults
FUNCTIONAL_TESTS = options.functional
UNIT_TESTS = options.unit
if not UNIT_TESTS and not FUNCTIONAL_TESTS:
raise RuntimeError('Nothing to run')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment