summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/python
diff options
context:
space:
mode:
authorTom Rondeau2010-12-23 22:13:36 -0500
committerTom Rondeau2010-12-23 22:13:36 -0500
commitd209240b15f98233770efd4b184fe429ba77171a (patch)
treec13f34c2f124d6384426992056a07582acf2a80d /gnuradio-core/src/python
parent79c514b542d25e709903b41cfdc1673aae35ac1d (diff)
parent7222b938cbfe0afd0886e4ce5e032cb756724903 (diff)
downloadgnuradio-d209240b15f98233770efd4b184fe429ba77171a.tar.gz
gnuradio-d209240b15f98233770efd4b184fe429ba77171a.tar.bz2
gnuradio-d209240b15f98233770efd4b184fe429ba77171a.zip
Merge branch 'master' into next
* master: clean now gets rid of unittest results. Passes distcheck. Modifying the unittest output. XML files are no longer written outside of the build tree. A new patch for fixing the alsa restart issue. Submitted by Volker Schroer. Reverting last change in alsa. PFB resampler: fix it this way to avoid the signed/unsigned warning. PFB resampler: fixes bug where filter could be looking past the number of inputs. Adding a "change in progress" check to alsa sink. Added a check in alsa sink if error has occurred due to blocking; if so, it will just drop samples and not get backed up. Patch taken from Marcus Leech 10/29/2010. Conflicts: Makefile.common gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc
Diffstat (limited to 'gnuradio-core/src/python')
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr_unittest.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr_unittest.py b/gnuradio-core/src/python/gnuradio/gr_unittest.py
index 50d484a76..c2c4df2ba 100755
--- a/gnuradio-core/src/python/gnuradio/gr_unittest.py
+++ b/gnuradio-core/src/python/gnuradio/gr_unittest.py
@@ -38,7 +38,7 @@ class TestCase(unittest.TestCase):
Note that decimal places (from zero) is usually not the same
as significant digits (measured from the most signficant digit).
- """
+ """
if round(second.real-first.real, places) != 0:
raise self.failureException, \
(msg or '%s != %s within %s places' % (`first`, `second`, `places` ))
@@ -112,30 +112,31 @@ def run(PUT, filename=None):
Runs the unittest on a TestCase and produces an optional XML report
PUT: the program under test and should be a gr_unittest.TestCase
filename: an optional filename to save the XML report of the tests
- this will live in $HOME/.gnuradio/unittests/python
+ this will live in ./.unittests/python
'''
# Run this is given a file name
if(filename is not None):
- homepath = os.getenv("HOME")
- basepath = homepath + "/.gnuradio"
- path = homepath + "/.gnuradio/unittests/python"
+ basepath = "./.unittests"
+ path = basepath + "/python"
+
+ if not os.path.exists(basepath):
+ os.makedirs(basepath, 0750)
xmlrunner = None
- if os.path.exists(basepath):
- # only proceed if $HOME/.gnuradio is writable
- st = os.stat(basepath)[stat.ST_MODE]
+ # only proceed if .unittests is writable
+ st = os.stat(basepath)[stat.ST_MODE]
+ if(st & stat.S_IWUSR > 0):
+ # Test if path exists; if not, build it
+ if not os.path.exists(path):
+ os.makedirs(path, 0750)
+
+ # Just for safety: make sure we can write here, too
+ st = os.stat(path)[stat.ST_MODE]
if(st & stat.S_IWUSR > 0):
- # Test if path exists; if not, build it
- if not os.path.exists(path):
- os.makedirs(path, 0750)
-
- # Just for safety: make sure we can write here, too
- st = os.stat(path)[stat.ST_MODE]
- if(st & stat.S_IWUSR > 0):
- # Create an XML runner to filename
- fout = file(path+"/"+filename, "w")
- xmlrunner = gr_xmlrunner.XMLTestRunner(fout)
+ # Create an XML runner to filename
+ fout = file(path+"/"+filename, "w")
+ xmlrunner = gr_xmlrunner.XMLTestRunner(fout)
txtrunner = TextTestRunner(verbosity=1)