Hi Robert,

One solution is to link in all dependencies in the binaries. A while
back I put together that does that and adds support for GTestSimObject
[1] as well as an example unit test for the LRURP [2].

[1]: https://gem5-review.googlesource.com/c/public/gem5/+/15315
[2]: https://gem5-review.googlesource.com/c/public/gem5/+/15316

Nikos

On 20/03/2019 17:06, Robert M. Kovacsics wrote:
> Hi,
>
> If I wanted to unit-test SimObjects, especially one which itself
> contains SimObjects (e.g. the Cache, which contains Tags), I was
> wondering if there is a way to easily instantiate such objects. Perhaps
> by running some C++ and python magic, like gem5 does when instantiating
> them for simulation.
>
> I have done a unit-test on non-SimObject classes (e.g. on the basis of
> src/base/trietest.cc) but not sure what to put in the "GTest(...)" in
> the SConscript (e.g. in src/base/SConscript for the trietest.cc) so that
> the generated C++ parameters classes are included, thus I am not sure
> how to generate SimObject C++ classes even manually. Perhaps the best
> way would be to have constructors for the unit-tests? This doesn't seem
> that scalable, so could I have some advice please?
>
> Thanks,
> Robert
> _______________________________________________
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
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-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to