Make the Individual tests linkable for meson
- In the current state, the tests can only be linkable
together into a single binary, as we are using the few
vaiables from external tests and using them during link
time to generate the executable.
- The idea of this commit is to make the unit test files
linkable individually, so that we have have a better way
of running unitests through meson, rather than bundling all
the tests into a gaigantic binary.
TestedBy:
The unit tests are passed in CI
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I67b953e5bc227d876139373aebeacbf5c20f56ef
diff --git a/test/test_rtnetlink.cpp b/test/test_rtnetlink.cpp
index 6a8c02d..47ccecf 100644
--- a/test/test_rtnetlink.cpp
+++ b/test/test_rtnetlink.cpp
@@ -19,26 +19,11 @@
namespace network
{
sdbusplus::bus::bus bus(sdbusplus::bus::new_default());
-std::unique_ptr<MockManager> manager = nullptr;
+extern std::unique_ptr<MockManager> manager;
extern std::unique_ptr<Timer> refreshObjectTimer;
extern std::unique_ptr<Timer> restartTimer;
EventPtr eventPtr = nullptr;
-/** @brief refresh the network objects. */
-void refreshObjects()
-{
- if (manager)
- {
- manager->createChildObjects();
- }
-}
-
-void initializeTimers()
-{
- refreshObjectTimer = std::make_unique<Timer>(
- sdeventplus::Event::get_default(), std::bind(refreshObjects));
-}
-
class TestRtNetlink : public testing::Test
{