Hi Alec,

Sure, we are currently using Google Testing framwork (gtest), even though I 
have to say there are not

so many unit tests around (just grep gtest and see)


I'd love to have more unit tests and to encourage people to always submit a 
test suite for every module they

are implementing. However there are some known issues related to


a) Dependecies

b) Mocks


(The two are related)


That's the reason why it is very easy to write unit tests for "leaf" modules 
(modules that are included but don't

have a lot of dependencies themselves, see src/base/coroutine.hh for an 
example) and there are no tests for SimObjects.


So before putting a DONE stamp on the source code, my advice would be to have a 
look at Dependency Injection and

Hi-perf Dependency Injection in Google Testing. You might end up on changing 
the code in order to make it

easy to place some unit tests for it.


Giacomo


________________________________
From: gem5-dev <[email protected]> on behalf of Alec Roelke 
<[email protected]>
Sent: 25 October 2018 00:49:19
To: gem5 Developer List
Subject: Re: [gem5-dev] Testing RISC-V Interrupts

Unit tests are certainly good for ensuring that the unit works as written,
but I'm more concerned with how it plays with the rest of the system.  It's
hard for me to tell what's calling what and when unless I can run it in a
way that exercises it.

But on the unit tests front, does gem5 have support for that?  I haven't
encountered this yet in my work on it.

On Mon, Oct 22, 2018 at 12:35 AM Gabe Black <[email protected]> wrote:

> I don't have an answer for you, but I think it's great you're making
> testing a priority. Maybe unit tests for the Fault objects? It would be
> nice to have unit tests for the interrupt controller objects too, but since
> they're probably SimObjects it's hard to get them to work in isolation.
>
> Gabe
>
> On Sun, Oct 21, 2018 at 9:17 AM Alec Roelke <[email protected]> wrote:
>
> > Hi Everyone,
> >
> > Over the past few weeks I've been working on an implementation for
> > interrupts in RISC-V so that it can eventually support FS mode fully, but
> > before I move on to another feature or submit a patch I would like to
> test
> > them to make sure they work.  I'm trying to avoid having to implement
> > everything at once before I do any testing, since that will make
> debugging
> > exponentially more difficult.  What is the best way I could test my
> > implementation of interrupts?
> >
> > Thanks,
> > Alec Roelke
> > _______________________________________________
> > gem5-dev mailing list
> > [email protected]
> > http://m5sim.org/mailman/listinfo/gem5-dev
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to