summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/gr_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/gr_unittest.py')
-rw-r--r--gnuradio-runtime/python/gnuradio/gr_unittest.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr_unittest.py b/gnuradio-runtime/python/gnuradio/gr_unittest.py
index 1b8323ad7a..190ea63354 100644
--- a/gnuradio-runtime/python/gnuradio/gr_unittest.py
+++ b/gnuradio-runtime/python/gnuradio/gr_unittest.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2004,2010 Free Software Foundation, Inc.
+# Copyright 2004,2010,2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -33,6 +33,7 @@ import unittest
from . import gr_xmlrunner
+
class TestCase(unittest.TestCase):
"""A subclass of unittest.TestCase that adds additional assertions
@@ -121,7 +122,8 @@ TextTestRunner = unittest.TextTestRunner
TestProgram = unittest.TestProgram
main = TestProgram
-def run(PUT, filename=None):
+
+def run(PUT, filename=None, verbosity=1):
'''
Runs the unittest on a TestCase and produces an optional XML report
PUT: the program under test and should be a gr_unittest.TestCase
@@ -152,7 +154,7 @@ def run(PUT, filename=None):
fout = open(path+"/"+filename, "w")
xmlrunner = gr_xmlrunner.XMLTestRunner(fout)
- txtrunner = TextTestRunner(verbosity=1)
+ txtrunner = TextTestRunner(verbosity=verbosity)
# Run the test; runner also creates XML output file
# FIXME: make xmlrunner output to screen so we don't have to do run and main
@@ -162,7 +164,7 @@ def run(PUT, filename=None):
if xmlrunner is not None:
xmlrunner.run(suite)
- main()
+ main(verbosity=verbosity)
# This will run and fail make check if problem
# but does not output to screen.
@@ -170,7 +172,7 @@ def run(PUT, filename=None):
else:
# If no filename is given, just run the test
- main()
+ main(verbosity=verbosity)
##############################################################################