Closed astroesteban closed 2 years ago
A while back we transitioned all constructors to accept names. FW_OBJECT_NAMES now decides if the name is discarded or stored and reported.
Here, we need to setup the UT templates to pass in a name. I believe this is your solution 3 above.
@LeStarch Could you point me to the UT templates? For the life of me I can't seem to locate them. Are they in this fprime project?
Tester.cpp: https://github.com/nasa/fprime/blob/devel/Autocoders/Python/src/fprime_ac/generators/templates/test_impl/cpp.tmpl Tester.hpp: https://github.com/nasa/fprime/blob/devel/Autocoders/Python/src/fprime_ac/generators/templates/test_impl/hpp.tmpl TesterBase.cpp: https://github.com/nasa/fprime/blob/devel/Autocoders/Python/src/fprime_ac/generators/templates/test/cpp.tmpl TesterBase.hpp: https://github.com/nasa/fprime/blob/devel/Autocoders/Python/src/fprime_ac/generators/templates/test/hpp.tmpl TestMain.cpp: https://github.com/nasa/fprime/blob/devel/Autocoders/Python/src/fprime_ac/generators/templates/test/test_main.tmpl GTestBase.cpp: https://github.com/nasa/fprime/blob/devel/Autocoders/Python/src/fprime_ac/generators/templates/gtest/cpp.tmpl GTestBase.hpp: https://github.com/nasa/fprime/blob/devel/Autocoders/Python/src/fprime_ac/generators/templates/gtest/hpp.tmpl
Thank you for taking the time to compile this list! I'll look into getting a fix in for this since I need it for my fprime bare metal port.
I would appreciate it!
@astroesteban any progress on this? We were thinking of including it in an upcoming delivery. Let me know if I can help, or if you'd like to toss this back at us.
Hey @LeStarch I'm gonna need to toss it back to y'all. I have to focus on some unrelated tasks for the time being.
@astroesteban no problem! Thanks for letting me know!
Problem Description
With
FW_OBJECT_NAMES
set to zero the generated Tester.cpp has an empty constructor:but that constructor is not defined in the component's implementation:
The TesterBase.cpp also has the same issue:
This results in a build error when trying to compile the unit tests.
How to Reproduce
I defined a component in FPP:
In my FpConfig.hpp file I have:
Ran
fprime-util generate --ut
Ran
fprime-util impl --ut
Then ran
fprime-util build --ut
Expected Behavior
There's three approaches that I can think of to fix this:
Blinker(const char *const compName);
constructor have a default argument:Blinker(const char *const compName = "");
component()
tocomponent("")
andFw::PassiveComponentBase()
toFw::PassiveComponentBase("")
in the test stubs.