Commit ab3bcd6c authored by Paolo Ambrosio's avatar Paolo Ambrosio
Browse files

Merge #99 'Generic driver'

parents b3e089b6 f37b9512
......@@ -11,5 +11,5 @@ Gemfile.lock
# Build artifacts
build/
#vim swap files
# vim swap files
*.swp
......@@ -4,7 +4,8 @@
* Support for Boost 1.60 ([#101](https://github.com/cucumber/cucumber-cpp/pull/101) Kai Unger)
* Support for CMake inclusion in other projects ([#76](https://github.com/cucumber/cucumber-cpp/pull/76) Eric Brayet)
* Added Qt5 suppor in CalcQt example ([#98](https://github.com/cucumber/cucumber-cpp/pull/98) Kamil Strzempowicz)
* Added Qt5 support in CalcQt example ([#98](https://github.com/cucumber/cucumber-cpp/pull/98) Kamil Strzempowicz)
* Improved Generic Driver to write steps without testing framework ([#99](https://github.com/cucumber/cucumber-cpp/pull/99) Kamil Strzempowicz)
### Bugfixes
......
#include <boost/test/unit_test.hpp>
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/autodetect.hpp>
#include <Calculator.h>
......
#include <CppSpec/CppSpec.h>
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/autodetect.hpp>
#include <Calculator.h>
......
#include <gtest/gtest.h>
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/autodetect.hpp>
#include <Calculator.h>
......
#include <cstdlib>
#include <boost/test/unit_test.hpp>
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/autodetect.hpp>
#include <QApplication>
#include <QTest>
......
#include <cstdlib>
#include <gtest/gtest.h>
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/autodetect.hpp>
#include <QApplication>
#include <QTest>
......
#include <gtest/gtest.h>
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/autodetect.hpp>
#include <string>
#include <map>
......
#include <gtest/gtest.h>
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/autodetect.hpp>
#include <iostream>
......
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/autodetect.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/format.hpp>
......
......@@ -231,7 +231,7 @@ EOF
def append_support_code(code)
helper_functions = get_absolute_path('../support/HelperFunctions.hpp');
@support_code ||= <<-EOF
#include <cucumber-cpp/defs.hpp>
#include <cucumber-cpp/generic.hpp>
#include "#{helper_functions}"
using cucumber::ScenarioScope;
......
#include "internal/defs.hpp"
#ifndef STEP_INHERITANCE
#error No test framework found: please include a testing framework before autodetect.hpp or include generic.hpp
#endif
#include "internal/step/StepManager.hpp"
#include "internal/hook/HookRegistrar.hpp"
#include "internal/ContextManager.hpp"
#include "internal/Macros.hpp"
#include "internal/drivers/DriverSelector.hpp"
#warning Use of defs.hpp is deprecated, please use either autodetect.hpp or generic.hpp
#include "internal/defs.hpp"
#ifndef STEP_INHERITANCE
#include "internal/drivers/GenericDriver.hpp"
#endif
#ifndef CUKE_DEPRECATED_DEFS_HPP_
#define CUKE_DEPRECATED_DEFS_HPP_
// ************************************************************************** //
// ************** USING_CONTEXT ************** //
// ************************************************************************** //
#define USING_CONTEXT(type, name) ::cucumber::ScenarioScope<type> name
#endif /* CUKE_DEPRECATED_DEFS_HPP_ */
#include "internal/defs.hpp"
#ifdef STEP_INHERITANCE
#error Test framework found: please include autodetect.hpp or remove the test framework includes
#else
#include "internal/drivers/GenericDriver.hpp"
#endif
#include "step/StepManager.hpp"
#include "hook/HookRegistrar.hpp"
#include "ContextManager.hpp"
#include "Macros.hpp"
#include "drivers/DriverSelector.hpp"
#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"
#else // No test framework
#include "FakeDriver.hpp"
#include "CppSpecDriver.hpp"
#endif
#ifndef CUKE_GENERICDRIVER_HPP_
#define CUKE_GENERICDRIVER_HPP_
#include "../step/StepManager.hpp"
namespace cucumber {
namespace internal {
class GenericStep : public BasicStep {
protected:
virtual const InvokeResult invokeStepBody();
};
#define STEP_INHERITANCE(step_name) virtual ::cucumber::internal::GenericStep
}
}
#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() {
const InvokeResult GenericStep::invokeStepBody() {
// No try/catch block to throw the original exceptions to the testing framework
body();
return InvokeResult::success();
......@@ -22,5 +11,3 @@ const InvokeResult FakeStep::invokeStepBody() {
}
}
#endif /* CUKE_FAKEDRIVER_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