cucumber / cucumber-cpp

Support for writing Cucumber step definitions in C++
MIT License
306 stars 131 forks source link

Fixed compile error when building with boost >= 1.70. #236

Closed meshell closed 4 years ago

meshell commented 4 years ago

Summary

Compiling BoostDriver.cpp fails because the signature of unit_test_log_formatter::log_build_info in boost/test/unit_test_log_formatter.hpp changed in boost version 1.70.

Details

Compiling BoostDriver.cpp with boost version 1.71 fails with:

/cucumber-cpp/src/drivers/BoostDriver.cpp: In static member function ‘static void cucumber::internal::BoostStep::initBoostTest()’:
/cucumber-cpp/src/drivers/BoostDriver.cpp:122:26: error: invalid new-expression of abstract class type ‘cucumber::internal::CukeBoostLogInterceptor’
  122 |     logInterceptor = new CukeBoostLogInterceptor;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~
/cucumber-cpp/src/drivers/BoostDriver.cpp:45:7: note:   because the following virtual functions are pure within ‘cucumber::internal::CukeBoostLogInterceptor’:
   45 | class CukeBoostLogInterceptor : public ::boost::unit_test::unit_test_log_formatter {
      |       ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /cucumber-cpp/src/drivers/BoostDriver.cpp:9:
/usr/include/boost/test/unit_test_log_formatter.hpp:144:25: note:   ‘virtual void boost::unit_test::unit_test_log_formatter::log_build_info(std::ostream&, bool)’
  144 |     virtual void        log_build_info( std::ostream& os, bool log_build_info = true ) = 0;
coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.5%) to 62.938% when pulling 15c0c3a5497e790a2569817739eb7290249a39ae on meshell:boost_170_fix into dd424c1a900cb41c5db9d481714eb3471ce195e3 on cucumber:master.

meshell commented 4 years ago

Same as Pull Request #225