Commit 79097337 authored by Kamil Strzempowicz's avatar Kamil Strzempowicz
Browse files

Replace FakeDriver with GenericDriver, warn when using it

parent b3e089b6
......@@ -11,5 +11,5 @@ Gemfile.lock
# Build artifacts
build/
#vim swap files
# vim swap files
*.swp
#define CUKE_ENABLE_GENERICDRIVER
#include <cucumber-cpp/defs.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/math/constants/constants.hpp>
......
......@@ -231,6 +231,7 @@ EOF
def append_support_code(code)
helper_functions = get_absolute_path('../support/HelperFunctions.hpp');
@support_code ||= <<-EOF
#define CUKE_ENABLE_GENERICDRIVER
#include <cucumber-cpp/defs.hpp>
#include "#{helper_functions}"
......
#if defined(GTEST_INCLUDE_GTEST_GTEST_H_)
#include "GTestDriver.hpp"
#include "GTestDriver.hpp"
#elif defined(BOOST_TEST_CASE)
#include "BoostDriver.hpp"
#include "BoostDriver.hpp"
#elif defined(CPPSPEC_H_)
#include "CppSpecDriver.hpp"
#include "CppSpecDriver.hpp"
#else // No test framework
#include "FakeDriver.hpp"
#ifdef CUKE_ENABLE_GENERICDRIVER
#include "GenericDriver.hpp"
#else
#error Please #inlude testing framework before cucumber-cpp or #define CUKE_ENABLE_GENERICDRIVER explicitly
#endif
#endif
#ifndef CUKE_GENERICDRIVER_HPP_
#define CUKE_GENERICDRIVER_HPP_
#include "../step/StepManager.hpp"
namespace cucumber {
namespace internal {
class FakeStep : public BasicStep {
protected:
virtual const InvokeResult invokeStepBody();
};
#define STEP_INHERITANCE(step_name) virtual ::cucumber::internal::FakeStep
}
}
#endif /* CUKE_GENERICDRIVER_HPP_ */
set(CUKE_SOURCES
drivers/GenericDriver.cpp
ContextManager.cpp
CukeCommands.cpp
CukeEngine.cpp
......
#ifndef CUKE_FAKEDRIVER_HPP_
#define CUKE_FAKEDRIVER_HPP_
#include "../step/StepManager.hpp"
#include "cucumber-cpp/internal/drivers/GenericDriver.hpp"
namespace cucumber {
namespace internal {
class FakeStep : public BasicStep {
protected:
const InvokeResult invokeStepBody();
};
#define STEP_INHERITANCE(step_name) ::cucumber::internal::FakeStep
const InvokeResult FakeStep::invokeStepBody() {
// No try/catch block to throw the original exceptions to the testing framework
body();
......@@ -22,5 +11,3 @@ const InvokeResult FakeStep::invokeStepBody() {
}
}
#endif /* CUKE_FAKEDRIVER_HPP_ */
......@@ -2,7 +2,7 @@
#include <cucumber-cpp/internal/step/StepManager.hpp>
#include <cucumber-cpp/internal/step/StepMacros.hpp>
#include <cucumber-cpp/internal/drivers/FakeDriver.hpp>
#include <cucumber-cpp/internal/drivers/GenericDriver.hpp>
using namespace cucumber::internal;
......
#include <gtest/gtest.h>
#include <cucumber-cpp/internal/drivers/FakeDriver.hpp>
#include <cucumber-cpp/internal/drivers/GenericDriver.hpp>
using namespace cucumber::internal;
......
......@@ -2,7 +2,7 @@
#define CUKE_CUKECOMMANDSFIXTURE_HPP_
#include <cucumber-cpp/internal/CukeCommands.hpp>
#include <cucumber-cpp/internal/drivers/FakeDriver.hpp>
#include <cucumber-cpp/internal/drivers/GenericDriver.hpp>
#include "StepManagerTestDouble.hpp"
#include <boost/shared_ptr.hpp>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment