My sink block captures data in fixed size timestamped files. If the test runs twice, when I go to check, I have twice the amount of data captured as what I read from the file source. I was looking everywhere for bugs before I concluded the test was being run twice by the test framework, but now that I know it is a possiblity, I can remove the capture files on test case setup so I can automate the checking of it. (Incidentally, I installed using pybombs and can report the version if somebody can tell me where to look.)
Presumably the two test invocations are not concurrent.... Thanks for your reply. Ranga. On Thu, Oct 15, 2015 at 10:05 AM, Tom Rondeau <[email protected]> wrote: > On Thu, Oct 15, 2015 at 9:39 AM, M. Ranganathan <[email protected]> wrote: > >> Hello, >> >> I generated a simple file sink block along with qa python tests. When I >> ran the test cases, I noticed that the test tool runs the test twice. Code >> is small enough that I am taking the liberty of posting it here: >> >> >> class qa_capture_sink (gr_unittest.TestCase): >> >> def setUp (self): >> self.tb = gr.top_block () >> self.u = >> blocks.file_source(gr.sizeof_float,"/tmp/testdata.bin",False) >> self.throttle = >> blocks.throttle(itemsize=gr.sizeof_float,samples_per_sec=1000) >> self.tb.connect(self.u,self.throttle) >> print "Create capture sink" >> sqr = capture.capture_sink(itemsize=gr.sizeof_float, chunksize = >> 500, capture_dir="/tmp") >> self.tb.connect(self.throttle,sqr) >> >> def tearDown (self): >> self.tb = None >> >> def test_001_t (self): >> self.tb.run () >> # check data TBD >> >> >> if __name__ == '__main__': >> gr_unittest.run(qa_capture_sink, "qa_capture_sink.xml") >> >> >> When I ran ctest -V , I noticed that the "Create capture sink" was being >> called twice. >> >> I would like for the test to run precisely once. Is gr_unittest set up >> with a parameter indicating how many times the test case should run? I >> looked around for documentation? >> >> Thank you in advance for your help. >> >> Regards, >> >> Ranga. >> >> -- >> M. Ranganathan >> > > > The first test outputs to the console. The second output to the XML file, > which we use in our CI system to monitor behavior. The testing system, that > I know of, doesn't allow for both at one time. > > Why do you care if it runs once or twice? If it runs fine once, it should > do so the second time, too. > > Tom > > -- M. Ranganathan
_______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
