discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Why are tests getting run twice?


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] Why are tests getting run twice?
Date: Thu, 15 Oct 2015 10:05:16 -0400

On Thu, Oct 15, 2015 at 9:39 AM, M. Ranganathan <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]