discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Testing 'noblock' Class


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Testing 'noblock' Class
Date: Thu, 2 Jun 2016 11:19:15 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

Dave,

what I did was

1. gr_modtool add -t noblock fooooo. Answer 'yes' when asked for a QA file.
2. Add a silly function to the new class
3. Populate the QA files
4. 'make test'

That's it. Worked fine.

M

On 06/01/2016 02:58 PM, Dave NotTelling wrote:
> Also, when I use CPPUNIT_ASSERT_MESSAGE("foobar\n", 1 == 2) I only see
> the 'F' get printed in the output of ./test-moo.  I do not see the
> requested message.  
> 
> Perhaps a better question would be are there any good examples of doing
> this?
> 
> Thanks!
> 
> On Wed, Jun 1, 2016 at 1:52 PM, Dave NotTelling <address@hidden
> <mailto:address@hidden>> wrote:
> 
>     That worked!  One more question: How do I make the test run with
>     'make test'?  It seems that 'make test' only runs the actual GNU
>     Radio modules and not the 'noblock' classes.
> 
>     On Wed, Jun 1, 2016 at 12:32 PM, Dave NotTelling
>     <address@hidden <mailto:address@hidden>> wrote:
> 
>         I was not using CPPUINT_ASSER_EQUAL.  I will give that a go
>         later today.  Thank you!
> 
>         On Wed, Jun 1, 2016 at 12:08 PM, Martin Braun
>         <address@hidden <mailto:address@hidden>> wrote:
> 
>             Are you using assert() or CPPUNIT_ASSERT_*?
> 
>             I just hacked something together, and it worked/failed just
>             fine.
> 
>             This is my class:
>             {{{
>              34     class TESTOR_API fooooo
>              35     {
>              36     public:
>              37       fooooo();
>              38       ~fooooo();
>              39
>              40       int return_five() { return 5; }
>              41     private:
>              42     };
>             }}}
> 
>             And my test:
>             {{{
>              30     void
>              31     qa_fooooo::t1()
>              32     {
>              33         fooooo F;
>              34         CPPUNIT_ASSERT_EQUAL(F.return_five(), 5);
>              35         CPPUNIT_ASSERT_EQUAL(F.return_five(), 6);
>              36     }
>             }}}
> 
>             Line 35 causes to fail when I run make test.
> 
>             M
> 
>             On 05/31/2016 12:36 PM, Dave NotTelling wrote:
>             > I created a noblock C++ class and asked for QA tests to be
>             created.  I
>             > see that the _qa files exist for both .h and .cc files. 
>             But, when I run
>             > 'make test' I only see the tests for the actual blocks
>             (sync in this
>             > case).  If I run ./lib/test-MyOTT then I see the output of
>             my noblock
>             > test, but the assert() calls don't cause a failure.  Am I
>             doing
>             > something wrong?
>             >
>             > Thank you!
>             >
>             > -Dave
>             >
>             >
>             > _______________________________________________
>             > Discuss-gnuradio mailing list
>             > address@hidden <mailto:address@hidden>
>             > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>             >
> 
> 
>             _______________________________________________
>             Discuss-gnuradio mailing list
>             address@hidden <mailto:address@hidden>
>             https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 
> 
> 




reply via email to

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