Skip to content

Commit f882282

Browse files
committed
new approach to GenericDriver
1 parent 695fb65 commit f882282

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

features/step_definitions/RpnCalculatorSteps.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define CUKE_ENABLE_GENERICDRIVER
21
#include <cucumber-cpp/defs.hpp>
32
#include <boost/algorithm/string.hpp>
43
#include <boost/math/constants/constants.hpp>

features/step_definitions/cucumber_cpp_mappings.rb

-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ def append_step_definition(step_name, code) # todo params parameter?
231231
def append_support_code(code)
232232
helper_functions = get_absolute_path('../support/HelperFunctions.hpp');
233233
@support_code ||= <<-EOF
234-
#define CUKE_ENABLE_GENERICDRIVER
235234
#include <cucumber-cpp/defs.hpp>
236235
#include "#{helper_functions}"
237236

include/cucumber-cpp/autodetect.hpp

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#if defined(GTEST_INCLUDE_GTEST_GTEST_H_)
2+
#include "internal/drivers/GTestDriver.hpp"
3+
#elif defined(BOOST_TEST_CASE)
4+
#include "internal/drivers/BoostDriver.hpp"
5+
#elif defined(CPPSPEC_H_)
6+
#include "internal/drivers/CppSpecDriver.hpp"
7+
#else
8+
#error No test framework found: Please #include testing framework before cucumber-cpp or #include defs.hpp for Generic Driver
9+
#endif
10+
11+
#include "internal/step/StepManager.hpp"
12+
#include "internal/hook/HookRegistrar.hpp"
13+
#include "internal/ContextManager.hpp"
14+
#include "internal/Macros.hpp"

include/cucumber-cpp/internal/drivers/DriverSelector.hpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,5 @@
55
#elif defined(CPPSPEC_H_)
66
#include "CppSpecDriver.hpp"
77
#else // No test framework
8-
#ifdef CUKE_ENABLE_GENERICDRIVER
9-
#include "GenericDriver.hpp"
10-
#else
11-
#error Please #inlude testing framework before cucumber-cpp or #define CUKE_ENABLE_GENERICDRIVER explicitly
12-
#endif
8+
#include "GenericDriver.hpp"
139
#endif

include/cucumber-cpp/internal/drivers/GenericDriver.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
namespace cucumber {
77
namespace internal {
88

9-
class FakeStep : public BasicStep {
9+
class GenericStep : public BasicStep {
1010
protected:
1111
virtual const InvokeResult invokeStepBody();
1212
};
1313

14-
#define STEP_INHERITANCE(step_name) virtual ::cucumber::internal::FakeStep
14+
#define STEP_INHERITANCE(step_name) virtual ::cucumber::internal::GenericStep
1515

1616
}
1717
}

src/drivers/GenericDriver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace cucumber {
44
namespace internal {
55

6-
const InvokeResult FakeStep::invokeStepBody() {
6+
const InvokeResult GenericStep::invokeStepBody() {
77
// No try/catch block to throw the original exceptions to the testing framework
88
body();
99
return InvokeResult::success();

0 commit comments

Comments
 (0)