cucumber / cucumber-cpp

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

Fix issue #81 by intercepting messages from BOOST_*_MESSAGE macros #164

Closed konserw closed 6 years ago

konserw commented 7 years ago

Summary

Intercept messages from BOOST_*_MESSAGE macros

Details

Motivation and Context

Fixes #81

How Has This Been Tested?

It has been tested manually by adding following line to BoostCalc example and running that example: BOOST_CHECK_MESSAGE(false, "Message");

Types of changes

Checklist:

muggenhor commented 7 years ago

Can you also add a test (perhaps in tests/integration/drivers) that fails without this change and succeeds with it?

konserw commented 7 years ago

Gladly, but I'm not sure how

konserw commented 7 years ago

@muggenhor - could you take a look at the test I've added? I'm not good with ruby... Also maybe we should rethink how the "support code" is inserted to every feature with C++ code?

konserw commented 7 years ago

@muggenhor how do you like it now? I kinda changed it other way around...

konserw commented 7 years ago

I've pasted wrong link twice. For failing test see this one: https://travis-ci.org/konserw/cucumber-cpp/jobs/268053073

konserw commented 7 years ago

I've created new feature file based on @paoloambrosio suggestions - now it contains more boost's macros. Now I've also rebased against newest master.

Build is failing due to #169

paoloambrosio commented 7 years ago

After adding the other scenarios, there is again some duplication. I've tried experimenting with a single ScenarioOutline with all the examples, and I think it would be very readable:

    Examples:
      | check                                         | passes or fails?                    |
      | BOOST_CHECK(false)                            | fails                               |
      | BOOST_CHECK_MESSAGE(false, "boost message")   | fails with message "boost message"  |
      | BOOST_ERROR("boost message")                  | fails with message "boost message"  |
      | BOOST_FAIL("boost message")                   | fails with message "boost message"  |
      | BOOST_REQUIRE(false)                          | fails                               |
      | BOOST_REQUIRE_MESSAGE(false, "boost message") | fails with message "boost message"  |
      | BOOST_WARN(false)                             | passes                              |
      | BOOST_WARN_MESSAGE(false, "boost message")    | passes                              |

What do you think?

konserw commented 7 years ago

Looks good - I've commited this change.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.003%) to 96.703% when pulling 59a351177d3372f911255338f4bc771aca178453 on konserw:issue81 into 0928f2568a9681291b8dff6a5fb3549305109324 on cucumber:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.007%) to 96.707% when pulling d9a8f3ca04b476aef0cdfb6f3193b5b6c4fb2bdb on konserw:issue81 into ffba6582a24b24847355cedbb03e33677b6df90b on cucumber:master.

konserw commented 6 years ago

All green - I just had to rebase on top of master after change in travis scripts. I'll merge now.