Skip to content

Commit

Permalink
Fix failing tests. Output details on failure to load proper number of…
Browse files Browse the repository at this point in the history
… plugins

Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Sep 17, 2023
1 parent 78942f3 commit 534fdeb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 0 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ get_property(COMPLEX_PLUGIN_COUNT GLOBAL PROPERTY COMPLEX_PLUGIN_COUNT)
# Create dependencies with complex_test on each of the test plugins
#------------------------------------------------------------------------------
if(COMPLEX_PLUGIN_ENABLE_TestOne)
MATH(EXPR COMPLEX_PLUGIN_COUNT "${COMPLEX_PLUGIN_COUNT}+1")
add_dependencies(complex_test TestOne)
endif()

if(COMPLEX_PLUGIN_ENABLE_TestTwo)
MATH(EXPR COMPLEX_PLUGIN_COUNT "${COMPLEX_PLUGIN_COUNT}+1")
add_dependencies(complex_test TestTwo)
endif()

Expand Down
17 changes: 17 additions & 0 deletions test/PluginTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ TEST_CASE("Test Loading Plugins")
const auto& filterHandles = filterList->getFilterHandles();
auto plugins = filterList->getLoadedPlugins();

if(plugins.size() != COMPLEX_PLUGIN_COUNT)
{
std::cout << "Incorrect number of plugins were loaded.\n" << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n";

Check warning on line 36 in test/PluginTest.cpp

View workflow job for this annotation

GitHub Actions / clang_format_pr

[clang-format] reported by reviewdog 🐶 Raw Output: test/PluginTest.cpp:36:- std::cout << "Incorrect number of plugins were loaded.\n" << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n"; test/PluginTest.cpp:36:+ std::cout << "Incorrect number of plugins were loaded.\n" test/PluginTest.cpp:37:+ << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n";

Check failure on line 36 in test/PluginTest.cpp

View workflow job for this annotation

GitHub Actions / clang_format_pr

code should be clang-formatted [-Wclang-format-violations]
for(auto const& plugin : plugins)
{
std::cout << plugin->getName() << std::endl;
}
}

REQUIRE(plugins.size() == COMPLEX_PLUGIN_COUNT);
REQUIRE(filterHandles.size() >= 2);

Expand Down Expand Up @@ -62,6 +71,14 @@ TEST_CASE("Test Singleton")
auto plugins = filterList->getLoadedPlugins();

// Check plugins were loaded
if(plugins.size() != COMPLEX_PLUGIN_COUNT)
{
std::cout << "Incorrect number of plugins were loaded.\n" << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n";

Check warning on line 76 in test/PluginTest.cpp

View workflow job for this annotation

GitHub Actions / clang_format_pr

[clang-format] reported by reviewdog 🐶 Raw Output: test/PluginTest.cpp:76:- std::cout << "Incorrect number of plugins were loaded.\n" << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n"; test/PluginTest.cpp:77:+ std::cout << "Incorrect number of plugins were loaded.\n" test/PluginTest.cpp:78:+ << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n";

Check failure on line 76 in test/PluginTest.cpp

View workflow job for this annotation

GitHub Actions / clang_format_pr

code should be clang-formatted [-Wclang-format-violations]
for(auto const& plugin : plugins)
{
std::cout << plugin->getName() << std::endl;
}
}
REQUIRE(plugins.size() == COMPLEX_PLUGIN_COUNT);

// Check filters loaded
Expand Down

0 comments on commit 534fdeb

Please sign in to comment.