no match for call to ‘(std::initializer_list<cute::runner<cute::xml_listener<cute::ide_listener<> > > >) (cute::suite&, const char [9])’

Added by Lukasz Walewski about 1 year ago

Hi,

Thanks for CUTE in the first place! It makes C++ unit testing really easy and integrates with Eclipse's CDT very nicely.

I am using CUTE Eclipse Plugin 5.0.0.201607041440 from the update site. I create a new "CUTE Library Test Project" using "Linux GCC" toolchain and "C++ Version" set to C++11. When I try to compile it afresh, i.e. before I start modifying Test.cpp etc, I get the following error:

../src/Test.cpp: In function ‘bool runAllTests(int, const char**)’:
../src/Test.cpp:17:37: error: no match for call to ‘(std::initializer_list<cute::runner<cute::xml_listener<cute::ide_listener<> > > >) (cute::suite&, const char [9])’
bool success = runner(s, "AllTests");

The problem does not depend on CUTE "CUTE Headers Version" (tested with 2.1.0, 2.0.1 and 1.7.0) but it goes away when I choose C++98, however in this case the default Test.cpp deosn't call runner(s, "AllTests") but cute::makeRunner(lis, argc, argv)(s, "AllTests").

Best regards,
Lukasz


Replies (4)

RE: no match for call to ‘(std::initializer_list<cute::runner<cute::xml_listener<cute::ide_listener<> > > >) (cute::suite&, const char [9])’ - Added by Thomas Corbat about 1 year ago

Hi Lukasz

Thanks a lot for the report. We will look into that as soon as possible!

Regards
Thomas

RE: no match for call to ‘(std::initializer_list<cute::runner<cute::xml_listener<cute::ide_listener<> > > >) (cute::suite&, const char [9])’ - Added by Thomas Corbat about 1 year ago

I've reproduced the issue, or at least tried. The problem is the incorrect use of braced initialization for the runner, which is declared as auto variable. I've updated the headers and I'll push a new version to the updatesite when the build-server agrees with my changes.
Until then you can manually fix the issue in your project by changing performing the following change.

Change this:

    auto runner { cute::makeRunner(lis, argc, argv) };

to:

    auto runner = cute::makeRunner(lis, argc, argv);

I hope this helps!

Regards
Thomas

RE: no match for call to ‘(std::initializer_list<cute::runner<cute::xml_listener<cute::ide_listener<> > > >) (cute::suite&, const char [9])’ - Added by Thomas Corbat about 1 year ago

The updatesites (/updatesite, /updatesite/neon and /updatesite/development) contain the new version of the headers.

RE: no match for call to ‘(std::initializer_list<cute::runner<cute::xml_listener<cute::ide_listener<> > > >) (cute::suite&, const char [9])’ - Added by Lukasz Walewski about 1 year ago

Hi Thomas, thanks a lot! The new version (5.0.0.201608030845 from /updatesite) solves the problem! Best, Lukasz

(1-4/4)