+ homepath = os.getenv("HOME")
+ basepath = homepath + "/.gnuradio"
+ path = homepath + "/.gnuradio/unittests/python"
+
+ xmlrunner = None
+ if os.path.exists(basepath):
+ # only proceed if $HOME/.gnuradio 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):
+ # Create an XML runner to filename
+ fout = file(path+"/"+filename, "w")
+ xmlrunner = gr_xmlrunner.XMLTestRunner(fout)