diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -1,11 +1 @@ -if(BUILD_TESTING) - find_package(Boost "1.40" COMPONENTS thread system regex date_time unit_test_framework) - if(Boost_UNIT_TEST_FRAMEWORK_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - set(CUKE_DISABLE_FUNCTIONAL TRUE) - set(CUKE_DISABLE_CPPSPEC TRUE) - set(CUKE_DISABLE_GTEST TRUE) - add_subdirectory(cucumber-cpp) - endif() -endif() add_subdirectory(kdepim) diff --git a/3rdparty/cucumber-cpp/CMakeLists.txt b/3rdparty/cucumber-cpp/CMakeLists.txt deleted file mode 100644 --- a/3rdparty/cucumber-cpp/CMakeLists.txt +++ /dev/null @@ -1,172 +0,0 @@ -cmake_minimum_required(VERSION 3.2) -if (POLICY CMP0063) - cmake_policy(SET CMP0063 NEW) -endif() - -project(Cucumber-Cpp) - -set(CUKE_USE_STATIC_BOOST ${MSVC} CACHE BOOL "Statically link Boost (except boost::test)") -set(CUKE_DISABLE_BOOST_TEST OFF CACHE BOOL "Disable boost:test") -#set(CUKE_DISABLE_CPPSPEC OFF CACHE BOOL "Disable CppSpec") -#set(CUKE_DISABLE_GTEST OFF CACHE BOOL "Disable Google Test framework") -#set(CUKE_DISABLE_FUNCTIONAL OFF CACHE BOOL "Disable Functional Tests") -set(CUKE_ENABLE_EXAMPLES OFF CACHE BOOL "Enable the examples") - -enable_testing() - -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) - -# -# Generic Compiler Flags -# - -if(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Weffc++") - # TODO: A better fix should handle ld's --as-needed flag - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker '--no-as-needed'") -elseif(MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOMINMAX") # exclude M$ min/max macros - #set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /analyze") -endif() - -# -# Boost -# - -if(MSVC11) - # Boost 1.51 fixed a bug with MSVC11 - message(STATUS "Forcing Boost 1.51+ on MSVC11") - set(BOOST_MIN_VERSION "1.51") -else() - set(BOOST_MIN_VERSION "1.40") -endif() - -set(CUKE_CORE_BOOST_LIBS thread system regex date_time) -if(NOT CUKE_DISABLE_BOOST_TEST) - set(CUKE_TEST_BOOST_LIBS unit_test_framework) -endif() - -if(CUKE_USE_STATIC_BOOST) - set(CUKE_STATIC_BOOST_LIBS ${CUKE_CORE_BOOST_LIBS}) - # "An external test runner utility is required to link with dynamic library" (Boost User's Guide) - set(CUKE_DYNAMIC_BOOST_LIBS ${CUKE_TEST_BOOST_LIBS}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_TEST_DYN_LINK") - - if(NOT MSVC) - find_package(Threads) - set(CUKE_EXTRA_LIBRARIES ${CUKE_EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) - endif() -else() - set(CUKE_DYNAMIC_BOOST_LIBS ${CUKE_CORE_BOOST_LIBS} ${CUKE_TEST_BOOST_LIBS}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_ALL_DYN_LINK") -endif() - -if(CUKE_STATIC_BOOST_LIBS) - set(Boost_USE_STATIC_LIBS ON) - find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS ${CUKE_STATIC_BOOST_LIBS}) -endif() - -if(CUKE_DYNAMIC_BOOST_LIBS) - set(Boost_USE_STATIC_LIBS OFF) - find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS ${CUKE_DYNAMIC_BOOST_LIBS}) -endif() - -if(Boost_FOUND) - include_directories(${Boost_INCLUDE_DIRS}) - set(CUKE_EXTRA_LIBRARIES ${CUKE_EXTRA_LIBRARIES} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) -endif() - -# -# CppSpec -# - -if(NOT CUKE_DISABLE_CPPSPEC) - find_package(CppSpec) -endif() - -# -# GTest -# - -if(NOT CUKE_DISABLE_GTEST) - find_package(GTest) - find_package(GMock) - if(GMOCK_FOUND AND GTEST_FOUND) - set(CUKE_TEST_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_BOTH_LIBRARIES}) - if(UNIX) - find_package(Threads) # GTest needs this and it's a static library - set(CUKE_TEST_LIBRARIES ${CUKE_TEST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) - endif() - endif() -endif() - -# -# Cucumber-Cpp -# - -set(CUKE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) - -include_directories(${CUKE_INCLUDE_DIR}) - -set(CUKE_LIBRARIES cucumber-cpp ${CUKE_EXTRA_LIBRARIES}) - -add_subdirectory(src) -add_subdirectory(tests) - -if(CUKE_ENABLE_EXAMPLES) - add_subdirectory(examples) -endif() - -# -# Functional Tests -# - -if(NOT CUKE_DISABLE_FUNCTIONAL) - - find_program(BUNDLE bundle) - if(BUNDLE) - message(STATUS "Installing gem dependencies") - execute_process(COMMAND ${BUNDLE} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - else() - message(WARNING "Could not find Bundler: skipping Ruby Gem management") - endif() - - find_program(CUCUMBER_RUBY cucumber) - if(CUCUMBER_RUBY) - message(STATUS "Found Cucumber") - set(CUKE_FEATURES_DIR ${CMAKE_SOURCE_DIR}/features) - set(CUKE_FEATURES_TMP ${CMAKE_BINARY_DIR}/tmp) - set(CUKE_TEST_FEATURES_DIR ${CUKE_FEATURES_TMP}/test_features) - set(CUKE_DYNAMIC_CPP_STEPS ${CUKE_TEST_FEATURES_DIR}/step_definitions/cpp_steps.cpp) - - file(WRITE ${CUKE_DYNAMIC_CPP_STEPS}) - add_executable(functional-steps EXCLUDE_FROM_ALL ${CUKE_DYNAMIC_CPP_STEPS}) - target_link_libraries(functional-steps ${CUKE_LIBRARIES}) - - # TODO It does not escape paths - set(CUKE_COMPILE_DYNAMIC_CPP_STEPS "${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target functional-steps") - - function(add_feature_target TARGET_NAME) - add_custom_target(${TARGET_NAME} - COMMAND ${CUCUMBER_RUBY} - TEST_FEATURES_DIR=${CUKE_TEST_FEATURES_DIR} - TMP_DIR=${CUKE_FEATURES_TMP} - DYNAMIC_CPP_STEPS_SRC=${CUKE_DYNAMIC_CPP_STEPS} - DYNAMIC_CPP_STEPS_EXE=${CMAKE_BINARY_DIR}/functional-steps - COMPILE_DYNAMIC_CPP_STEPS=${CUKE_COMPILE_DYNAMIC_CPP_STEPS} - ${ARGV1} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5} ${ARGV6} - ${CUKE_FEATURES_DIR} - DEPENDS cucumber-cpp - ) - endfunction(add_feature_target) - - add_feature_target(features --format progress) - add_feature_target(features-pretty --format pretty) - add_feature_target(features-wip --format pretty --tags @wip) - - else() - message(WARNING "Could not find Cucumber: skipping functional tests") - endif() - -endif() - diff --git a/3rdparty/cucumber-cpp/CONTRIBUTING.md b/3rdparty/cucumber-cpp/CONTRIBUTING.md deleted file mode 100644 --- a/3rdparty/cucumber-cpp/CONTRIBUTING.md +++ /dev/null @@ -1,50 +0,0 @@ -## About to create a new Github Issue? - -We appreciate that. But before you do, please learn our basic rules: - -* This is not a support or discussion forum. If you have a question, please ask it on [The Cukes Google Group](http://groups.google.com/group/cukes). -* Do you have a feature request? Then don't expect it to be implemented unless you or someone else sends a [pull request](https://help.github.com/articles/using-pull-requests). -* Reporting a bug? We need to know what compiler, operating system and architecture (32 or 64 bit) you are using, including versions of all libraries. Bugs with [pull requests](https://help.github.com/articles/using-pull-requests) get fixed quicker. Some bugs may never be fixed. -* You have to tell us how to reproduce a bug. Bonus point for a [pull request](https://help.github.com/articles/using-pull-requests) with a failing test that reproduces the bug. -* Want to paste some code or output? Put \`\`\` on a line above and below your code/output. See [GFM](https://help.github.com/articles/github-flavored-markdown)'s *Fenced Code Blocks* for details. -* We love [pull requests](https://help.github.com/articles/using-pull-requests), but if you don't have a test to go with it we probably won't merge it. - -## Contributing - -Before you can contribute, you have to be able to build the source and run tests. - -### The Github Process - -The process for using git/github is similar to the [Github-Flow](http://scottchacon.com/2011/08/31/github-flow.html) - -* **Anything** in the master branch is good enough to release -* Working on nontrivial features - + Create a descriptively named branch off of master - + Commit to that branch locally and regularly - + Push your work to the same named branch on the server - + Regularly rebase this branch from master to keep it up to date -* Open a pull request - + When you need feedback or help - + You think the branch is ready for merging (you can use the [hub](https://github.com/defunkt/hub#git-pull-request) command-line tool) -* For any nontrivial change, even if you have the rights to merge the pull request yourself, wait before someone else has reviewed and agreed on the change - -Here is an [Example](https://github.com/cucumber/bool/pull/12) of this process in action - -#### Tips for good commits - -1. Read up on [Github Flavored Markdown](https://help.github.com/articles/github-flavored-markdown) - + Especially links and syntax highlighting. GFM can be used in tickets as well as commit messages (e.g. put "#4" somewhere in a commit message to link ticket 4 to that commit -2. Close tickets with commits if you can - + Add "Closes #5, #9" somewhere in the commit message to both link and close. See [Issues 2.0 the Next Generation](https://github.com/blog/831-issues-2-0-the-next-generation) for details. - + Use [this script](https://gist.github.com/aslakhellesoy/4754009) to compile and view GFM locally -3. Tag issues so we can do better triage and assignment. - + People tend to gravitate towards areas of expertise and tags makes it easier to give a ticket to the right person. -4. Update HISTORY.md - + When you fix a bug or add a feature - + Add release dates -5. Subscribe to ticket feeds so you stay in the loop and get a chance to provide feedback on tickets -6. The code standard is the existing code - + Use the same indentation, spacing, line ending, ASCII for source code, UTF-8 everywhere else -7. Use git diff (or git diff --cached if you have staged) before every commit - + This helps you avoid committing changes you didn't mean to - diff --git a/3rdparty/cucumber-cpp/Gemfile b/3rdparty/cucumber-cpp/Gemfile deleted file mode 100644 --- a/3rdparty/cucumber-cpp/Gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source 'https://rubygems.org' - -group :test do - gem 'cucumber', "=1.3.6" - gem 'aruba' - gem 'rspec' -end - diff --git a/3rdparty/cucumber-cpp/HISTORY.md b/3rdparty/cucumber-cpp/HISTORY.md deleted file mode 100644 --- a/3rdparty/cucumber-cpp/HISTORY.md +++ /dev/null @@ -1,27 +0,0 @@ -## [0.3](https://github.com/cucumber/cucumber-cpp/compare/v0.2...v0.3) (22 December 2013) - -### New Features - -* Added BEFORE_ALL and AFTER_ALL macros ([#65](https://github.com/cucumber/cucumber-cpp/pull/65) Larry Price) -* Added CalcQt example ([#58](https://github.com/cucumber/cucumber-cpp/pull/58) Gianni Ambrosio) -* Replaced USING_CONTEXT with ScenarioScope ([27256e9](https://github.com/cucumber/cucumber-cpp/commit/27256e932c75e9d4d57d4839042317e6a04cfe46) Paolo Ambrosio) -* Changed include name from core.hpp to defs.hpp ([5bbac06](https://github.com/cucumber/cucumber-cpp/commit/5bbac062e19dcf9de2761f4ded115aa7212c14d7) Paolo Ambrosio) -* Project rename from CukeBins to Cucumber-Cpp ([efecfd0](https://github.com/cucumber/cucumber-cpp/commit/efecfd0813efa1b6d406c2fd0cd03d8a84bed3ff) Paolo Ambrosio) - -### Bugfixes - -* Fixed socket server bug in VS2012 forcing Boost 1.51 ([#57](https://github.com/cucumber/cucumber-cpp/pull/57) Jared Szechy, [e41a9b7](https://github.com/cucumber/cucumber-cpp/commit/e681c5028a756d8f711574a86e84ca8b98333d5c) Paolo Ambrosio) -* Fixed crashes on some architectures ([#52](https://github.com/cucumber/cucumber-cpp/pull/52) Sabst) -* Fixed AFTER hook ordering issue ([#43](https://github.com/cucumber/cucumber-cpp/pull/43) Greg Williams) -* Added default empty constructor to work with less permissive gcc 4.6 settings ([#38](https://github.com/cucumber/cucumber-cpp/pull/38) Hugo Ferreira) - - -## [0.2](https://github.com/cucumber/cucumber-cpp/compare/v0.1...v0.2) (25 June 2011) - -TODO - - -## [0.1](https://github.com/cucumber/cucumber-cpp/commits/v0.1) (03 May 2010) - -* Initial implementation - diff --git a/3rdparty/cucumber-cpp/LICENSE.txt b/3rdparty/cucumber-cpp/LICENSE.txt deleted file mode 100644 --- a/3rdparty/cucumber-cpp/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010 Paolo Ambrosio - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/3rdparty/cucumber-cpp/README.md b/3rdparty/cucumber-cpp/README.md deleted file mode 100644 --- a/3rdparty/cucumber-cpp/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Cucumber-CPP - -[![Build Status](https://travis-ci.org/cucumber/cucumber-cpp.png)](https://travis-ci.org/cucumber/cucumber-cpp) - -Cucumber-Cpp allows Cucumber to support step definitions written in C++. - -* [Cucumber-Cpp Website](http://github.com/cucumber/cucumber-cpp) -* [Cucumber-Cpp Documentation](https://github.com/cucumber/cucumber-cpp/wiki/) -* [Cucumber Website](http://cukes.info/) -* [Cucumber Discussion Group](http://groups.google.com/group/cukes) - -If you need to ask a question, don't open a ticket on GitHub! Please post -your question on the Cucumber discussion group instead, prefixing the title -with [CPP]. - -It relies on a few libraries: - -* [Boost](http://www.boost.org/) 1.40 or later. - Required libraries: *thread*, *system*, *regex*, and *date_time*. - Optional library for Boost Test driver: *test*. -* [GTest](http://code.google.com/p/googletest/) 1.4 or later. - Optional for the GTest driver. -* [CppSpec](https://github.com/tpuronen/cppspec) development branch. - Optional for the CppSpec driver. -* [GMock](http://code.google.com/p/googlemock/) 1.6 or later. - Optional for the internal test suite. -* [Qt 4](http://qt-project.org/). Optional for the CalcQt example. - -This header-only library is included in the source code: - -* [JSON Spirit](http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx) - -It might work with earlier versions of the libraries, but it was not -tested with them. - -Cucumber-Cpp uses the wire protocol at the moment, so you will need -Cucumber-Ruby installed and available on the path. It is also needed -to run the functional test suite. - -Building Cucumber-Cpp with tests and samples: - -``` -cmake -E make_directory build -cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on .. -cmake --build build -cmake --build build --target test -cmake --build build --target features -``` - -Running the Calc example on Unix: - -``` -build/examples/Calc/BoostCalculatorSteps >/dev/null & -cucumber examples/Calc -``` - -Running the Calc example on Windows (NMake): - -``` -start build\examples\Calc\BoostCalculatorSteps.exe -cucumber examples\Calc -``` - diff --git a/3rdparty/cucumber-cpp/cmake/modules/FindCppSpec.cmake b/3rdparty/cucumber-cpp/cmake/modules/FindCppSpec.cmake deleted file mode 100644 --- a/3rdparty/cucumber-cpp/cmake/modules/FindCppSpec.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Locate CppSpec: Behaviour driven development with C++ -# -# Defines the following variables: -# -# CPPSPEC_FOUND - Found CppSpec -# CPPSPEC_INCLUDE_DIR - Include directories -# CPPSPEC_LIBRARY - libCppSpec -# - -find_path(CPPSPEC_INCLUDE_DIR CppSpec/CppSpec.h - HINTS - $ENV{CPPSPEC_ROOT}/include - ${CPPSPEC_ROOT}/include -) - -find_library(CPPSPEC_LIBRARY CppSpec - HINTS - $ENV{CPPSPEC_ROOT}/lib - ${CPPSPEC_ROOT}/lib) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(CPPSPEC DEFAULT_MSG CPPSPEC_LIBRARY CPPSPEC_INCLUDE_DIR) -mark_as_advanced(CPPSPEC_LIBRARY CPPSPEC_INCLUDE_DIR) diff --git a/3rdparty/cucumber-cpp/cmake/modules/FindGMock.cmake b/3rdparty/cucumber-cpp/cmake/modules/FindGMock.cmake deleted file mode 100644 --- a/3rdparty/cucumber-cpp/cmake/modules/FindGMock.cmake +++ /dev/null @@ -1,113 +0,0 @@ -# Locate the Google C++ Mocking Framework. -# (This file is almost an identical copy of the original FindGTest.cmake file, -# feel free to use it as it is or modify it for your own needs.) -# -# -# Defines the following variables: -# -# GMOCK_FOUND - Found the Google Testing framework -# GMOCK_INCLUDE_DIRS - Include directories -# -# Also defines the library variables below as normal -# variables. These contain debug/optimized keywords when -# a debugging library is found. -# -# GMOCK_BOTH_LIBRARIES - Both libgmock & libgmock-main -# GMOCK_LIBRARIES - libgmock -# GMOCK_MAIN_LIBRARIES - libgmock-main -# -# Accepts the following variables as input: -# -# GMOCK_ROOT - (as a CMake or environment variable) -# The root directory of the gmock install prefix -# -# -#----------------------- -# Example Usage: -# -# find_package(GMock REQUIRED) -# include_directories(${GMOCK_INCLUDE_DIRS}) -# -# add_executable(foo foo.cc) -# target_link_libraries(foo ${GMOCK_BOTH_LIBRARIES}) -# -#============================================================================= -# This file is released under the MIT licence: -# -# Copyright (c) 2011 Matej Svec -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -#============================================================================= - - -function(_gmock_append_debugs _endvar _library) - if(${_library} AND ${_library}_DEBUG) - set(_output optimized ${${_library}} debug ${${_library}_DEBUG}) - else() - set(_output ${${_library}}) - endif() - set(${_endvar} ${_output} PARENT_SCOPE) -endfunction() - -function(_gmock_find_library _name) - find_library(${_name} - NAMES ${ARGN} - HINTS - $ENV{GMOCK_ROOT} - ${GMOCK_ROOT} - PATH_SUFFIXES ${_gmock_libpath_suffixes} - ) - mark_as_advanced(${_name}) -endfunction() - - -set(_gmock_libpath_suffixes lib) -if(MSVC) - if(MSVC_VERSION GREATER 1400) - list(APPEND _gmock_libpath_suffixes - msvc/2010/Debug - msvc/2010/Release) - else() - list(APPEND _gmock_libpath_suffixes - msvc/2005/Debug - msvc/2005/Release) - endif() -endif() - -find_path(GMOCK_INCLUDE_DIR gmock/gmock.h - HINTS - $ENV{GMOCK_ROOT}/include - ${GMOCK_ROOT}/include -) -mark_as_advanced(GMOCK_INCLUDE_DIR) - -_gmock_find_library(GMOCK_LIBRARY gmock) -_gmock_find_library(GMOCK_LIBRARY_DEBUG gmockd) -_gmock_find_library(GMOCK_MAIN_LIBRARY gmock_main) -_gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_maind) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMock DEFAULT_MSG GMOCK_LIBRARY GMOCK_INCLUDE_DIR GMOCK_MAIN_LIBRARY) - -if(GMOCK_FOUND) - set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR}) - _gmock_append_debugs(GMOCK_LIBRARIES GMOCK_LIBRARY) - _gmock_append_debugs(GMOCK_MAIN_LIBRARIES GMOCK_MAIN_LIBRARY) - set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARIES} ${GMOCK_MAIN_LIBRARIES}) -endif() - diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/defs.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/defs.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/defs.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "internal/step/StepManager.hpp" -#include "internal/hook/HookRegistrar.hpp" -#include "internal/ContextManager.hpp" - -#include "internal/Macros.hpp" -#include "internal/drivers/DriverSelector.hpp" diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/deprecated-defs.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/deprecated-defs.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/deprecated-defs.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CUKE_DEPRECATED_DEFS_HPP_ -#define CUKE_DEPRECATED_DEFS_HPP_ - - -// ************************************************************************** // -// ************** USING_CONTEXT ************** // -// ************************************************************************** // - -#define USING_CONTEXT(type, name) ::cucumber::ScenarioScope name - - -#endif /* CUKE_DEPRECATED_DEFS_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/ContextManager.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/ContextManager.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/ContextManager.hpp +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef CUKE_CONTEXTMANAGER_HPP_ -#define CUKE_CONTEXTMANAGER_HPP_ - -#include - -#include -#include - -namespace cucumber { - -using boost::shared_ptr; -using boost::weak_ptr; - -namespace internal { - -typedef std::vector > contexts_type; - -class ContextManager { -public: - void purgeContexts(); - template weak_ptr addContext(); - -protected: - static contexts_type contexts; -}; - -template -weak_ptr ContextManager::addContext() { - shared_ptr shared(new T); - contexts.push_back(shared); - return weak_ptr (shared); -} - -} - -template -class ScenarioScope { -public: - ScenarioScope(); - - T& operator*(); - T* operator->(); - T* get(); - -private: - internal::ContextManager contextManager; - shared_ptr context; - static weak_ptr contextReference; -}; - -template -weak_ptr ScenarioScope::contextReference; - -template -ScenarioScope::ScenarioScope() { - if (contextReference.expired()) { - contextReference = contextManager.addContext (); - } - context = contextReference.lock(); -} - -template -T& ScenarioScope::operator*() { - return *(context.get()); -} - -template -T* ScenarioScope::operator->() { - return (context.get()); -} - -template -T* ScenarioScope::get() { - return context.get(); -} - -} - -#endif /* CUKE_CONTEXTMANAGER_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeCommands.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeCommands.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeCommands.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef CUKE_CUKECOMMANDS_HPP_ -#define CUKE_CUKECOMMANDS_HPP_ - -#include "ContextManager.hpp" -#include "Scenario.hpp" -#include "Table.hpp" -#include "step/StepManager.hpp" -#include "hook/HookRegistrar.hpp" - -#include -#include -#include - -#include - -namespace cucumber { -namespace internal { - -using boost::shared_ptr; - -/** - * Legacy class to be removed when feature #31 is complete, substituted by CukeEngineImpl. - */ -class CukeCommands { -public: - CukeCommands(); - virtual ~CukeCommands(); - - void beginScenario(const TagExpression::tag_list *tags); - void endScenario(); - const std::string snippetText(const std::string stepKeyword, const std::string stepName) const; - MatchResult stepMatches(const std::string description) const; - InvokeResult invoke(step_id_type id, const InvokeArgs * pArgs); - -private: - StepManager stepManager; - HookRegistrar hookRegistrar; - ContextManager contextManager; - bool hasStarted; - -private: - static shared_ptr currentScenario; -}; - -} -} - -#endif /* CUKE_CUKECOMMANDS_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeEngine.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeEngine.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeEngine.hpp +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef CUKE_CUKEENGINE_HPP_ -#define CUKE_CUKEENGINE_HPP_ - -#include -#include - -#include - -namespace cucumber { -namespace internal { - -class StepMatchArg { -public: - std::string value; - int position; -}; - -class StepMatch { -public: - std::string id; - std::vector args; - std::string source; - std::string regexp; -}; - -class InvokeException { -private: - const std::string message; - -public: - InvokeException(const std::string & message); - InvokeException(const InvokeException &rhs); - - const std::string getMessage() const; - - virtual ~InvokeException() {} -}; - -class InvokeFailureException : public InvokeException { -private: - const std::string exceptionType; - -public: - InvokeFailureException(const std::string & message, const std::string & exceptionType); - InvokeFailureException(const InvokeFailureException &rhs); - - const std::string getExceptionType() const; -}; - -class PendingStepException : public InvokeException { -public: - PendingStepException(const std::string & message); - PendingStepException(const PendingStepException &rhs); -}; - -/** - * The entry point to Cucumber. - * - * It uses standard types (as much as possible) to be easier to call. - * Returns standard types if possible. - */ -class CukeEngine { -private: - typedef std::vector string_array; - typedef boost::multi_array string_2d_array; -public: - typedef string_array tags_type; - typedef string_array invoke_args_type; - typedef string_2d_array invoke_table_type; - - /** - * Finds steps whose regexp match some text. - */ - virtual std::vector stepMatches(const std::string & name) const = 0; - - /** - * Starts a scenario. - */ - virtual void beginScenario(const tags_type & tags) = 0; - - /** - * Invokes a step passing arguments to it. - * - * @throws InvokeException if the test fails or it is pending - */ - virtual void invokeStep(const std::string & id, const invoke_args_type & args, const invoke_table_type & tableArg) = 0; - - /** - * Ends a scenario. - */ - virtual void endScenario(const tags_type & tags) = 0; - - /** - * Returns the step definition for a pending step. - */ - virtual std::string snippetText(const std::string & keyword, const std::string & name, const std::string & multilineArgClass) const = 0; - - virtual ~CukeEngine() {} -}; - -} -} - -#endif /* CUKE_CUKEENGINE_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeEngineImpl.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeEngineImpl.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/CukeEngineImpl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef CUKE_CUKEENGINE_IMPL_HPP_ -#define CUKE_CUKEENGINE_IMPL_HPP_ - -#include "CukeEngine.hpp" -#include "CukeCommands.hpp" - -namespace cucumber { -namespace internal { - -/** - * Default Engine Implementation - * - * Currently it is a wrapper around CukeCommands. It will have its own - * implementation when feature #31 is complete. - */ -class CukeEngineImpl : public CukeEngine { -private: - CukeCommands cukeCommands; - -public: - std::vector stepMatches(const std::string & name) const; - void beginScenario(const tags_type & tags); - void invokeStep(const std::string & id, const invoke_args_type & args, const invoke_table_type & tableArg); - void endScenario(const tags_type & tags); - std::string snippetText(const std::string & keyword, const std::string & name, const std::string & multilineArgClass) const; -}; - -} -} - -#endif /* CUKE_CUKEENGINE_IMPL_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Macros.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Macros.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Macros.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CUKE_MACROS_HPP_ -#define CUKE_MACROS_HPP_ - -#include "RegistrationMacros.hpp" -#include "step/StepMacros.hpp" -#include "hook/HookMacros.hpp" - -#endif /* CUKE_MACROS_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/RegistrationMacros.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/RegistrationMacros.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/RegistrationMacros.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef CUKE_REGISTRATIONMACROS_HPP_ -#define CUKE_REGISTRATIONMACROS_HPP_ - -// ************************************************************************** // -// ************** OBJECT NAMING MACROS ************** // -// ************************************************************************** // - -#ifndef CUKE_OBJECT_PREFIX -#define CUKE_OBJECT_PREFIX CukeObject -#endif - -#ifdef __COUNTER__ -#define CUKE_GEN_OBJECT_NAME_ BOOST_JOIN(CUKE_OBJECT_PREFIX, __COUNTER__) -#else -// Use a counter to be incremented every time cucumber-cpp is included -// in case this does not suffice (possible with multiple files only) -#define CUKE_GEN_OBJECT_NAME_ BOOST_JOIN(CUKE_OBJECT_PREFIX, __LINE__) -#endif - -// ************************************************************************** // -// ************** CUKE OBJECTS ************** // -// ************************************************************************** // - -#define CUKE_OBJECT_(class_name, parent_class, registration_fn) \ -class class_name : public parent_class { \ -public: \ - void body(); \ -private: \ - static const int cukeRegId; \ -}; \ -const int class_name ::cukeRegId = registration_fn ; \ -void class_name ::body() \ -/**/ - -#endif /* CUKE_REGISTRATIONMACROS_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Scenario.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Scenario.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Scenario.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef CUKE_SCENARIO_HPP_ -#define CUKE_SCENARIO_HPP_ - -#include "hook/Tag.hpp" - -namespace cucumber { -namespace internal { - -class Scenario { -public: - Scenario(const TagExpression::tag_list *pTags); - - const TagExpression::tag_list & getTags(); -private: - shared_ptr pTags; -}; - -} -} - -#endif /* CUKE_SCENARIO_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Table.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Table.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/Table.hpp +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef CUKE_TABLE_HPP_ -#define CUKE_TABLE_HPP_ - -#include -#include -#include -#include - -namespace cucumber { -namespace internal { - -class Table { -private: - typedef std::vector basic_type; -public: - typedef std::map hash_row_type; - typedef basic_type columns_type; - typedef basic_type row_type; - typedef std::vector hashes_type; - - /** - * @brief addColumn - * @param column - * - * @throws std::runtime_error - */ - void addColumn(const std::string column); - - /** - * @brief addRow - * @param row - * - * @throws std::range_error - * @throws std::runtime_error - */ - void addRow(const row_type &row); - const hashes_type & hashes() const; - -private: - hash_row_type buildHashRow(const row_type &row); - - columns_type columns; - hashes_type rows; -}; - -} -} - -#endif /* CUKE_TABLE_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/ProtocolHandler.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/ProtocolHandler.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/ProtocolHandler.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef CUKE_PROTOCOLHANDLER_HPP_ -#define CUKE_PROTOCOLHANDLER_HPP_ - -#include - -namespace cucumber { -namespace internal { - -/** - * Protocol that reads one command for each input line. - */ -class ProtocolHandler { -public: - virtual std::string handle(const std::string &request) const = 0; - virtual ~ProtocolHandler() {}; -}; - -} -} - -#endif /* CUKE_PROTOCOLHANDLER_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireProtocol.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireProtocol.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireProtocol.hpp +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef CUKE_WIREPROTOCOL_HPP_ -#define CUKE_WIREPROTOCOL_HPP_ - -#include "ProtocolHandler.hpp" -#include "../../CukeEngine.hpp" - -namespace cucumber { -namespace internal { - -/* - * Response messages - */ - -class WireResponseVisitor; - -class WireResponse { -public: - WireResponse() {}; - - virtual void accept(WireResponseVisitor *visitor) const = 0; - - virtual ~WireResponse() {}; -}; - -class SuccessResponse : public WireResponse { -public: - void accept(WireResponseVisitor *visitor) const; -}; - -class FailureResponse : public WireResponse { -private: - const std::string message, exceptionType; - -public: - FailureResponse(const std::string & message = "", const std::string & exceptionType = ""); - - const std::string getMessage() const; - const std::string getExceptionType() const; - - void accept(WireResponseVisitor *visitor) const; -}; - -class PendingResponse : public WireResponse { -private: - const std::string message; - -public: - PendingResponse(const std::string & message); - - const std::string getMessage() const; - - void accept(WireResponseVisitor *visitor) const; -}; - -class StepMatchesResponse : public WireResponse { -private: - const std::vector matchingSteps; - -public: - StepMatchesResponse(const std::vector & matchingSteps); - const std::vector& getMatchingSteps() const; - - void accept(WireResponseVisitor *visitor) const; -}; - -class SnippetTextResponse : public WireResponse { -private: - const std::string stepSnippet; - -public: - SnippetTextResponse(const std::string & stepSnippet); - - const std::string getStepSnippet() const; - - void accept(WireResponseVisitor *visitor) const; -}; - -class WireResponseVisitor { -public: - virtual void visit(const SuccessResponse *response) = 0; - virtual void visit(const FailureResponse *response) = 0; - virtual void visit(const PendingResponse *response) = 0; - virtual void visit(const StepMatchesResponse *response) = 0; - virtual void visit(const SnippetTextResponse *response) = 0; - - virtual ~WireResponseVisitor() {}; -}; - - -/** - * Wire protocol request command. - */ -class WireCommand { -public: - /** - * Runs the command on the provided engine - * - * @param The engine - * - * @return The command response (ownership passed to the caller) - */ - virtual WireResponse *run(CukeEngine *engine) const = 0; - - virtual ~WireCommand() {}; -}; - -class WireMessageCodecException : public std::exception { -private: - const char *description; - -public: - WireMessageCodecException(const char *description) : - description(description) { - } - - const char* what() const throw() { - return description; - } -}; - - -/** - * Transforms wire messages into commands and responses to messages. - */ -class WireMessageCodec { -public: - /** - * Decodes a wire message into a command. - * - * @param One single message to decode - * - * @return The decoded command (ownership passed to the caller) - * - * @throws WireMessageCodecException - */ - virtual WireCommand *decode(const std::string &request) const = 0; - - /** - * Encodes a response to wire format. - * - * @param Response to encode - * - * @return The encoded string - */ - virtual const std::string encode(const WireResponse *response) const = 0; - - virtual ~WireMessageCodec() {}; -}; - -/** - * WireMessageCodec implementation with JsonSpirit. - */ -class JsonSpiritWireMessageCodec : public WireMessageCodec { -public: - JsonSpiritWireMessageCodec(); - WireCommand *decode(const std::string &request) const; - const std::string encode(const WireResponse *response) const; -}; - -/** - * Wire protocol handler, delegating JSON encoding and decoding to a - * codec object and running commands on a provided engine instance. - */ -class WireProtocolHandler : public ProtocolHandler { -private: - const WireMessageCodec *codec; - CukeEngine *engine; - -public: - WireProtocolHandler(const WireMessageCodec *codec, CukeEngine *engine); - - std::string handle(const std::string &request) const; -}; - -} -} - -#endif /* CUKE_WIREPROTOCOL_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireProtocolCommands.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireProtocolCommands.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireProtocolCommands.hpp +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef CUKE_WIREPROTOCOL_COMMANDS_HPP_ -#define CUKE_WIREPROTOCOL_COMMANDS_HPP_ - -#include "WireProtocol.hpp" - -namespace cucumber { -namespace internal { - -class ScenarioCommand : public WireCommand { -protected: - std::auto_ptr tags; - - ScenarioCommand(const CukeEngine::tags_type *tags); -}; - - -class BeginScenarioCommand : public ScenarioCommand { -public: - BeginScenarioCommand(const CukeEngine::tags_type *tags); - - WireResponse *run(CukeEngine *engine) const; -}; - - -class EndScenarioCommand : public ScenarioCommand { -public: - EndScenarioCommand(const CukeEngine::tags_type *tags); - - WireResponse *run(CukeEngine *engine) const; -}; - - -class StepMatchesCommand : public WireCommand { -private: - const std::string stepName; - -public: - StepMatchesCommand(const std::string & stepName); - - WireResponse *run(CukeEngine *engine) const; -}; - - -class InvokeCommand : public WireCommand { -private: - const std::string stepId; - std::auto_ptr args; - std::auto_ptr tableArg; - -public: - InvokeCommand(const std::string & stepId, - const CukeEngine::invoke_args_type *args, - const CukeEngine::invoke_table_type * tableArg); - - WireResponse *run(CukeEngine *engine) const; -}; - - -class SnippetTextCommand : public WireCommand { -private: - std::string keyword, name, multilineArgClass; - -public: - SnippetTextCommand(const std::string & keyword, - const std::string & name, - const std::string & multilineArgClass); - - WireResponse *run(CukeEngine *engine) const; -}; - - -class FailingCommand : public WireCommand { -public: - WireResponse *run(CukeEngine *engine) const; -}; - -} -} - -#endif /* CUKE_WIREPROTOCOL_COMMANDS_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireServer.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireServer.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/connectors/wire/WireServer.hpp +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef CUKE_WIRESERVER_HPP_ -#define CUKE_WIRESERVER_HPP_ - -#include "ProtocolHandler.hpp" - -#include - -#include - -namespace cucumber { -namespace internal { - -using namespace boost::asio; -using namespace boost::asio::ip; - -/** - * Socket server that calls a protocol handler line by line - */ -class SocketServer { -public: - /** - * Type definition for TCP port - */ - typedef unsigned short port_type; - - /** - * Constructor for DI - */ - SocketServer(const ProtocolHandler *protocolHandler); - - /** - * Bind and listen to a TCP port - */ - void listen(const port_type port); - - /** - * Accept one connection - */ - void acceptOnce(); - - ~SocketServer() {}; // Forbid inheritance - -private: - const ProtocolHandler *protocolHandler; - io_service ios; - tcp::acceptor acceptor; - - void processStream(tcp::iostream &stream); -}; - -} -} - -#endif /* CUKE_WIRESERVER_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/BoostDriver.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/BoostDriver.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/BoostDriver.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef CUKE_BOOSTDRIVER_HPP_ -#define CUKE_BOOSTDRIVER_HPP_ - -#include "../step/StepManager.hpp" - -namespace cucumber { -namespace internal { - -class CukeBoostLogInterceptor; - -class BoostStep : public BasicStep { -protected: - const InvokeResult invokeStepBody(); - -private: - void initBoostTest(); - void runWithMasterSuite(); -}; - -#define STEP_INHERITANCE(step_name) ::cucumber::internal::BoostStep - -} -} - -#endif /* CUKE_BOOSTDRIVER_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/CppSpecDriver.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/CppSpecDriver.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/CppSpecDriver.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef CUKE_CPPSPECDRIVER_HPP_ -#define CUKE_CPPSPECDRIVER_HPP_ - -#include "../step/StepManager.hpp" - -namespace cucumber { -namespace internal { - -class CppSpecStep : public BasicStep { -protected: - const InvokeResult invokeStepBody(); -}; - -#define STEP_INHERITANCE(step_name) ::cucumber::internal::CppSpecStep, CppSpec::Specification - -} -} - -#endif /* CUKE_CPPSPECDRIVER_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/DriverSelector.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/DriverSelector.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/DriverSelector.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#if defined(GTEST_INCLUDE_GTEST_GTEST_H_) -#include "GTestDriver.hpp" -#elif defined(BOOST_TEST_CASE) -#include "BoostDriver.hpp" -#elif defined(CPPSPEC_H_) -#include "CppSpecDriver.hpp" -#else // No test framework -#include "FakeDriver.hpp" -#endif diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/FakeDriver.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/FakeDriver.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/FakeDriver.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef CUKE_FAKEDRIVER_HPP_ -#define CUKE_FAKEDRIVER_HPP_ - -#include "../step/StepManager.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(); - return InvokeResult::success(); -} - -} -} - -#endif /* CUKE_FAKEDRIVER_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/GTestDriver.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/GTestDriver.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/drivers/GTestDriver.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef CUKE_GTESTDRIVER_HPP_ -#define CUKE_GTESTDRIVER_HPP_ - -#include "../step/StepManager.hpp" - -#include - -namespace cucumber { -namespace internal { - -class GTestStep : public BasicStep { -protected: - const InvokeResult invokeStepBody(); - -private: - void initGTest(); - void initFlags(); - -protected: - static bool initialized; -}; - -#define STEP_INHERITANCE(step_name) ::cucumber::internal::GTestStep - -} -} - -#endif /* CUKE_GTESTDRIVER_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/HookMacros.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/HookMacros.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/HookMacros.hpp +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef CUKE_HOOKMACROS_HPP_ -#define CUKE_HOOKMACROS_HPP_ - -#include "../RegistrationMacros.hpp" - -// ************************************************************************** // -// ************** BEFORE HOOK ************** // -// ************************************************************************** // - -#define BEFORE(...) \ -BEFORE_WITH_NAME_(CUKE_GEN_OBJECT_NAME_, "" #__VA_ARGS__) \ -/**/ - -#define BEFORE_WITH_NAME_(step_name, tag_expression) \ -CUKE_OBJECT_( \ - step_name, \ - ::cucumber::internal::BeforeHook, \ - BEFORE_HOOK_REGISTRATION_(step_name, tag_expression) \ -) \ -/**/ - -#define BEFORE_HOOK_REGISTRATION_(step_name, tag_expression) \ -::cucumber::internal::registerBeforeHook(tag_expression) \ -/**/ - -// ************************************************************************** // -// ************** AROUND_STEP HOOK ************** // -// ************************************************************************** // - -#define AROUND_STEP(...) \ -AROUND_STEP_WITH_NAME_(CUKE_GEN_OBJECT_NAME_, "" #__VA_ARGS__) \ -/**/ - -#define AROUND_STEP_WITH_NAME_(step_name, tag_expression) \ -CUKE_OBJECT_( \ - step_name, \ - ::cucumber::internal::AroundStepHook, \ - AROUND_STEP_HOOK_REGISTRATION_(step_name, tag_expression) \ -) \ -/**/ - -#define AROUND_STEP_HOOK_REGISTRATION_(step_name, tag_expression) \ -::cucumber::internal::registerAroundStepHook(tag_expression) \ -/**/ - -// ************************************************************************** // -// ************** AFTER_STEP HOOK ************** // -// ************************************************************************** // - -#define AFTER_STEP(...) \ -AFTER_STEP_WITH_NAME_(CUKE_GEN_OBJECT_NAME_, "" #__VA_ARGS__) \ -/**/ - -#define AFTER_STEP_WITH_NAME_(step_name, tag_expression) \ -CUKE_OBJECT_( \ - step_name, \ - ::cucumber::internal::AfterStepHook, \ - AFTER_STEP_HOOK_REGISTRATION_(step_name, tag_expression) \ -) \ -/**/ - -#define AFTER_STEP_HOOK_REGISTRATION_(step_name, tag_expression) \ -::cucumber::internal::registerAfterStepHook(tag_expression) \ -/**/ - - -// ************************************************************************** // -// ************** AFTER HOOK ************** // -// ************************************************************************** // - -#define AFTER(...) \ -AFTER_WITH_NAME_(CUKE_GEN_OBJECT_NAME_, "" #__VA_ARGS__) \ -/**/ - -#define AFTER_WITH_NAME_(step_name, tag_expression) \ -CUKE_OBJECT_( \ - step_name, \ - ::cucumber::internal::AfterHook, \ - AFTER_HOOK_REGISTRATION_(step_name, tag_expression) \ -) \ -/**/ - -#define AFTER_HOOK_REGISTRATION_(step_name, tag_expression) \ -::cucumber::internal::registerAfterHook(tag_expression) \ -/**/ - -// ************************************************************************** // -// ************** BEFORE_ALL HOOK ************** // -// ************************************************************************** // - -#define BEFORE_ALL() \ -BEFORE_ALL_WITH_NAME_(CUKE_GEN_OBJECT_NAME_) \ -/**/ - -#define BEFORE_ALL_WITH_NAME_(step_name) \ -CUKE_OBJECT_( \ - step_name, \ - ::cucumber::internal::BeforeAllHook, \ - BEFORE_ALL_HOOK_REGISTRATION_(step_name) \ -) \ -/**/ - -#define BEFORE_ALL_HOOK_REGISTRATION_(step_name) \ -::cucumber::internal::registerBeforeAllHook() \ -/**/ - -// ************************************************************************** // -// ************** AFTER_ALL HOOK ************** // -// ************************************************************************** // - -#define AFTER_ALL() \ -AFTER_ALL_WITH_NAME_(CUKE_GEN_OBJECT_NAME_) \ -/**/ - -#define AFTER_ALL_WITH_NAME_(step_name) \ -CUKE_OBJECT_( \ - step_name, \ - ::cucumber::internal::AfterAllHook, \ - AFTER_ALL_HOOK_REGISTRATION_(step_name) \ -) \ -/**/ - -#define AFTER_ALL_HOOK_REGISTRATION_(step_name) \ -::cucumber::internal::registerAfterAllHook() \ -/**/ - -#endif /* CUKE_HOOKMACROS_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/HookRegistrar.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/HookRegistrar.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/HookRegistrar.hpp +++ /dev/null @@ -1,180 +0,0 @@ -#ifndef CUKE_HOOKREGISTRAR_HPP_ -#define CUKE_HOOKREGISTRAR_HPP_ - -#include "Tag.hpp" -#include "../Scenario.hpp" -#include "../step/StepManager.hpp" - -#include -using boost::shared_ptr; - -#include - -namespace cucumber { -namespace internal { - -class CallableStep { -public: - virtual void call() = 0; -}; - -class Hook { -public: - void setTags(const std::string &csvTagNotation); - virtual void invokeHook(Scenario *scenario); - virtual void skipHook(); - virtual void body() = 0; -protected: - bool tagsMatch(Scenario *scenario); -private: - shared_ptr tagExpression; -}; - -class BeforeHook : public Hook { -}; - -class AroundStepHook : public Hook { -public: - virtual void invokeHook(Scenario *scenario, CallableStep *step); - virtual void skipHook(); -protected: - CallableStep *step; -}; - -class AfterStepHook : public Hook { -}; - -class AfterHook : public Hook { -}; - -class UnconditionalHook : public Hook { -public: - virtual void invokeHook(Scenario *); -}; - -class BeforeAllHook : public UnconditionalHook { -}; - -class AfterAllHook : public UnconditionalHook { -}; - -class HookRegistrar { -public: - typedef std::list hook_list_type; - typedef std::list aroundhook_list_type; - - virtual ~HookRegistrar(); - - void addBeforeHook(BeforeHook *afterHook); - void execBeforeHooks(Scenario *scenario); - - void addAroundStepHook(AroundStepHook *aroundStepHook); - InvokeResult execStepChain(Scenario *scenario, StepInfo *stepInfo, const InvokeArgs *pArgs); - - void addAfterStepHook(AfterStepHook *afterStepHook); - void execAfterStepHooks(Scenario *scenario); - - void addAfterHook(AfterHook *afterHook); - void execAfterHooks(Scenario *scenario); - - void addBeforeAllHook(BeforeAllHook *beforeAllHook); - void execBeforeAllHooks(); - - void addAfterAllHook(AfterAllHook *afterAllHook); - void execAfterAllHooks(); - -private: - void execHooks(HookRegistrar::hook_list_type &hookList, Scenario *scenario); - -protected: - hook_list_type& beforeAllHooks(); - hook_list_type& beforeHooks(); - aroundhook_list_type& aroundStepHooks(); - hook_list_type& afterStepHooks(); - hook_list_type& afterHooks(); - hook_list_type& afterAllHooks(); -}; - - -class StepCallChain { -public: - StepCallChain(Scenario *scenario, StepInfo *stepInfo, const InvokeArgs *pStepArgs, HookRegistrar::aroundhook_list_type &aroundHooks); - InvokeResult exec(); - void execNext(); -private: - void execStep(); - - Scenario *scenario; - StepInfo *stepInfo; - const InvokeArgs *pStepArgs; - - HookRegistrar::aroundhook_list_type::iterator nextHook; - HookRegistrar::aroundhook_list_type::iterator hookEnd; - InvokeResult result; -}; - -class CallableStepChain : public CallableStep { -public: - CallableStepChain(StepCallChain *scc); - void call(); -private: - StepCallChain *scc; -}; - - -template -static int registerBeforeHook(const std::string &csvTagNotation) { - HookRegistrar reg; - T *hook = new T; - hook->setTags(csvTagNotation); - reg.addBeforeHook(hook); - return 0; // We are not interested in the ID at this time -} - -template -static int registerAroundStepHook(const std::string &csvTagNotation) { - HookRegistrar reg; - T *hook = new T; - hook->setTags(csvTagNotation); - reg.addAroundStepHook(hook); - return 0; -} - -template -static int registerAfterStepHook(const std::string &csvTagNotation) { - HookRegistrar reg; - T *hook = new T; - hook->setTags(csvTagNotation); - reg.addAfterStepHook(hook); - return 0; -} - -template -static int registerAfterHook(const std::string &csvTagNotation) { - HookRegistrar reg; - T *hook = new T; - hook->setTags(csvTagNotation); - reg.addAfterHook(hook); - return 0; -} - -template -static int registerBeforeAllHook() { - HookRegistrar reg; - T *hook = new T; - reg.addBeforeAllHook(hook); - return 0; -} - -template -static int registerAfterAllHook() { - HookRegistrar reg; - T *hook = new T; - reg.addAfterAllHook(hook); - return 0; -} - -} -} - -#endif /* CUKE_HOOKREGISTRAR_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/Tag.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/Tag.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/hook/Tag.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef CUKE_TAG_HPP_ -#define CUKE_TAG_HPP_ - -#include -#include - -#include -using boost::shared_ptr; - -#include "../utils/Regex.hpp" - -namespace cucumber { -namespace internal { - -class TagExpression { -public: - typedef std::vector tag_list; - - virtual bool matches(const tag_list &tags) = 0; -}; - -class OrTagExpression : public TagExpression { -public: - OrTagExpression(const std::string &csvTagNotation); - bool matches(const tag_list &tags); - -private: - bool orTagMatchesTagList(const std::string ¤tOrTag, const tag_list &tags); - - tag_list orTags; - - static Regex & csvTagNotationRegex(); -}; - -class AndTagExpression : public TagExpression { -public: - AndTagExpression(const std::string &csvTagNotation); - bool matches(const tag_list &tags); - -private: - typedef std::list > or_expressions_type; - or_expressions_type orExpressions; - - static Regex & csvTagNotationRegex(); -}; - -} -} - -#endif /* CUKE_TAG_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/step/StepMacros.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/step/StepMacros.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/step/StepMacros.hpp +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef CUKE_STEPMACROS_HPP_ -#define CUKE_STEPMACROS_HPP_ - -#include "../RegistrationMacros.hpp" - -// ************************************************************************** // -// ************** STEP ************** // -// ************************************************************************** // - -#define CUKE_STEP_(step_matcher) \ -CUKE_STEP_WITH_NAME_(CUKE_GEN_OBJECT_NAME_, step_matcher) \ -/**/ - -#define CUKE_STEP_WITH_NAME_(step_name, step_matcher) \ -CUKE_OBJECT_( \ - step_name, \ - STEP_INHERITANCE(step_name), \ - CUKE_STEP_REGISTRATION_(step_name, step_matcher) \ -) \ -/**/ - -#define CUKE_STEP_REGISTRATION_(step_name, step_matcher) \ -::cucumber::internal::registerStep< step_name >( \ - step_matcher, __FILE__, __LINE__ \ -) \ -/**/ - -// ************************************************************************** // -// ************** GIVEN/WHEN/THEN ************** // -// ************************************************************************** // - -#define GIVEN CUKE_STEP_ -#define WHEN CUKE_STEP_ -#define THEN CUKE_STEP_ - -// ************************************************************************** // -// ************** REGEX_PARAM ************** // -// ************************************************************************** // - -#define REGEX_PARAM(type, name) const type name(getInvokeArg()) -#define TABLE_PARAM(name) const ::cucumber::internal::Table & name = \ - getArgs()->getTableArg() - -#endif /* CUKE_STEPMACROS_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/step/StepManager.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/step/StepManager.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/step/StepManager.hpp +++ /dev/null @@ -1,236 +0,0 @@ -#ifndef CUKE_STEPMANAGER_HPP_ -#define CUKE_STEPMANAGER_HPP_ - -#include -#include -#include -#include -#include - -#include -using boost::shared_ptr; - -#include "../Table.hpp" -#include "../utils/Regex.hpp" - -namespace cucumber { -namespace internal { - -typedef unsigned int step_id_type; - -class StepInfo; - -class SingleStepMatch { -public: - typedef RegexMatch::submatches_type submatches_type; - - SingleStepMatch(); - SingleStepMatch(const SingleStepMatch &match); - - SingleStepMatch & operator =(const SingleStepMatch &match); - operator void *(); - - const StepInfo *stepInfo; - submatches_type submatches; -}; - - -class MatchResult { -public: - typedef std::vector match_results_type; - - const match_results_type& getResultSet(); - void addMatch(SingleStepMatch match); - - operator void *(); - operator bool(); - -private: - match_results_type resultSet; -}; - - -class InvokeArgs { - typedef std::vector args_type; -public: - typedef args_type::size_type size_type; - - InvokeArgs() { } - - void addArg(const std::string arg); - Table & getVariableTableArg(); - - template T getInvokeArg(size_type i) const; - const Table & getTableArg() const; -private: - Table tableArg; - args_type args; -}; - -enum InvokeResultType { - SUCCESS, - FAILURE, - PENDING -}; - -class InvokeResult { -private: - InvokeResultType type; - std::string description; - - InvokeResult(const InvokeResultType type, const char *description); -public: - InvokeResult(); - InvokeResult(const InvokeResult &ir); - InvokeResult& operator= (const InvokeResult& rhs); - - static InvokeResult success(); - static InvokeResult failure(const char *description); - static InvokeResult failure(const std::string &description); - static InvokeResult pending(const char *description); - - bool isSuccess() const; - bool isPending() const; - const InvokeResultType getType() const; - const std::string &getDescription() const; -}; - - -class StepInfo { -public: - StepInfo(const std::string &stepMatcher, const std::string source); - SingleStepMatch matches(const std::string &stepDescription); - virtual InvokeResult invokeStep(const InvokeArgs * pArgs) = 0; - - step_id_type id; - Regex regex; - const std::string source; -}; - - -class BasicStep { -public: - InvokeResult invoke(const InvokeArgs *pArgs); - -protected: - typedef const Table table_type; - typedef const Table::hashes_type table_hashes_type; - - virtual const InvokeResult invokeStepBody() = 0; - virtual void body() = 0; - - void pending(const char *description); - void pending(); - - template const T getInvokeArg(); - const InvokeArgs *getArgs(); -private: - // FIXME: awful hack because of Boost::Test - InvokeResult currentResult; - - const InvokeArgs *pArgs; - InvokeArgs::size_type currentArgIndex; -}; - - -template -class StepInvoker : public StepInfo { -public: - StepInvoker(const std::string &stepMatcher, const std::string source); - - InvokeResult invokeStep(const InvokeArgs *args); -}; - - -class StepManager { -protected: - typedef std::map steps_type; - -public: - virtual ~StepManager(); - - void addStep(StepInfo *stepInfo); - MatchResult stepMatches(const std::string &stepDescription) const; - StepInfo *getStep(step_id_type id); -protected: - steps_type& steps() const; -}; - - -static std::string toSourceString(const char *filePath, const int line) { - using namespace std; - stringstream s; - string file(filePath); - string::size_type pos = file.find_last_of("/\\"); - if (pos == string::npos) { - s << file; - } else { - s << file.substr(++pos); - } - s << ":" << line; - return s.str(); -} - -template -static int registerStep(const std::string &stepMatcher, const char *file, const int line) { - StepManager s; - StepInfo *stepInfo = new StepInvoker(stepMatcher, toSourceString(file, line)); - s.addStep(stepInfo); - return stepInfo->id; -} - -template -T fromString(const std::string& s) { - std::istringstream stream(s); - T t; - stream >> t; - if (stream.fail()) { - throw std::invalid_argument("Cannot convert parameter"); - } - return t; -} - -template<> -inline std::string fromString(const std::string& s) { - return s; -} - -template -std::string toString(T arg) { - std::stringstream s; - s << arg; - return s.str(); -} - - -template -T InvokeArgs::getInvokeArg(size_type i) const { - if (i >= args.size()) { - throw std::invalid_argument("Parameter not found"); - } - return fromString(args.at(i)); -} - - -template -const T BasicStep::getInvokeArg() { - return pArgs->getInvokeArg(currentArgIndex++); -} - - -template -StepInvoker::StepInvoker(const std::string &stepMatcher, const std::string source) : - StepInfo(stepMatcher, source) { -} - -template -InvokeResult StepInvoker::invokeStep(const InvokeArgs *pArgs) { - T t; - return t.invoke(pArgs); -} - - -} -} - -#endif /* CUKE_STEPMANAGER_HPP_ */ diff --git a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/utils/Regex.hpp b/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/utils/Regex.hpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/cucumber-cpp/internal/utils/Regex.hpp +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef CUKE_REGEX_HPP_ -#define CUKE_REGEX_HPP_ - -#include - -#include - -namespace cucumber { -namespace internal { - -struct RegexSubmatch { - std::string value; - int position; -}; - - -class RegexMatch { -public: - typedef std::vector submatches_type; - - virtual ~RegexMatch() {}; - - bool matches(); - const submatches_type & getSubmatches(); - -protected: - bool regexMatched; - submatches_type submatches; -}; - -class FindRegexMatch : public RegexMatch { -public: - FindRegexMatch(const boost::regex ®exImpl, const std::string &expression); -}; - -class FindAllRegexMatch : public RegexMatch { -public: - FindAllRegexMatch(const boost::regex ®exImpl, const std::string &expression); -}; - - -class Regex { -private: - boost::regex regexImpl; - -public: - Regex(std::string expr); - - RegexMatch *find(const std::string &expression); - RegexMatch *findAll(const std::string &expression); - - std::string str() const; -}; - -} -} - -#endif /* CUKE_REGEX_HPP_ */ - diff --git a/3rdparty/cucumber-cpp/include/json_spirit/CMakeLists.txt b/3rdparty/cucumber-cpp/include/json_spirit/CMakeLists.txt deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -SET(JSON_SPIRIT_SRCS -json_spirit_reader.cpp -json_spirit_value.cpp -json_spirit_writer.cpp) - -FIND_PACKAGE(Boost 1.34 REQUIRED) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) - -ADD_LIBRARY(json_spirit STATIC ${JSON_SPIRIT_SRCS}) - diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef JSON_SPIRIT -#define JSON_SPIRIT - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -#include "json_spirit_value.h" -#include "json_spirit_reader.h" -#include "json_spirit_writer.h" -#include "json_spirit_utils.h" - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit.vcproj b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit.vcproj deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit.vcproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_error_position.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_error_position.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_error_position.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef JSON_SPIRIT_ERROR_POSITION -#define JSON_SPIRIT_ERROR_POSITION - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -#include - -namespace json_spirit -{ - // An Error_position exception is thrown by the "read_or_throw" functions below on finding an error. - // Note the "read_or_throw" functions are around 3 times slower than the standard functions "read" - // functions that return a bool. - // - struct Error_position - { - Error_position(); - Error_position( unsigned int line, unsigned int column, const std::string& reason ); - bool operator==( const Error_position& lhs ) const; - unsigned int line_; - unsigned int column_; - std::string reason_; - }; - - inline Error_position::Error_position() - : line_( 0 ) - , column_( 0 ) - { - } - - inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason ) - : line_( line ) - , column_( column ) - , reason_( reason ) - { - } - - inline bool Error_position::operator==( const Error_position& lhs ) const - { - if( this == &lhs ) return true; - - return ( reason_ == lhs.reason_ ) && - ( line_ == lhs.line_ ) && - ( column_ == lhs.column_ ); -} -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef JSON_SPIRIT_READER -#define JSON_SPIRIT_READER - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -#include "json_spirit_value.h" -#include "json_spirit_error_position.h" -#include - -namespace json_spirit -{ - // functions to reads a JSON values - - bool read( const std::string& s, Value& value ); - bool read( std::istream& is, Value& value ); - bool read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ); - - void read_or_throw( const std::string& s, Value& value ); - void read_or_throw( std::istream& is, Value& value ); - void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ); - -#ifndef BOOST_NO_STD_WSTRING - - bool read( const std::wstring& s, wValue& value ); - bool read( std::wistream& is, wValue& value ); - bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ); - - void read_or_throw( const std::wstring& s, wValue& value ); - void read_or_throw( std::wistream& is, wValue& value ); - void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ); - -#endif - - bool read( const std::string& s, mValue& value ); - bool read( std::istream& is, mValue& value ); - bool read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ); - - void read_or_throw( const std::string& s, mValue& value ); - void read_or_throw( std::istream& is, mValue& value ); - void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ); - -#ifndef BOOST_NO_STD_WSTRING - - bool read( const std::wstring& s, wmValue& value ); - bool read( std::wistream& is, wmValue& value ); - bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ); - - void read_or_throw( const std::wstring& s, wmValue& value ); - void read_or_throw( std::wistream& is, wmValue& value ); - void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ); - -#endif -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader.cpp b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#include "json_spirit_reader.h" -#include "json_spirit_reader_template.h" - -using namespace json_spirit; - -bool json_spirit::read( const std::string& s, Value& value ) -{ - return read_string( s, value ); -} - -void json_spirit::read_or_throw( const std::string& s, Value& value ) -{ - read_string_or_throw( s, value ); -} - -bool json_spirit::read( std::istream& is, Value& value ) -{ - return read_stream( is, value ); -} - -void json_spirit::read_or_throw( std::istream& is, Value& value ) -{ - read_stream_or_throw( is, value ); -} - -bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) -{ - return read_range( begin, end, value ); -} - -void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) -{ - begin = read_range_or_throw( begin, end, value ); -} - -#ifndef BOOST_NO_STD_WSTRING - -bool json_spirit::read( const std::wstring& s, wValue& value ) -{ - return read_string( s, value ); -} - -void json_spirit::read_or_throw( const std::wstring& s, wValue& value ) -{ - read_string_or_throw( s, value ); -} - -bool json_spirit::read( std::wistream& is, wValue& value ) -{ - return read_stream( is, value ); -} - -void json_spirit::read_or_throw( std::wistream& is, wValue& value ) -{ - read_stream_or_throw( is, value ); -} - -bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) -{ - return read_range( begin, end, value ); -} - -void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) -{ - begin = read_range_or_throw( begin, end, value ); -} - -#endif - -bool json_spirit::read( const std::string& s, mValue& value ) -{ - return read_string( s, value ); -} - -void json_spirit::read_or_throw( const std::string& s, mValue& value ) -{ - read_string_or_throw( s, value ); -} - -bool json_spirit::read( std::istream& is, mValue& value ) -{ - return read_stream( is, value ); -} - -void json_spirit::read_or_throw( std::istream& is, mValue& value ) -{ - read_stream_or_throw( is, value ); -} - -bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) -{ - return read_range( begin, end, value ); -} - -void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) -{ - begin = read_range_or_throw( begin, end, value ); -} - -#ifndef BOOST_NO_STD_WSTRING - -bool json_spirit::read( const std::wstring& s, wmValue& value ) -{ - return read_string( s, value ); -} - -void json_spirit::read_or_throw( const std::wstring& s, wmValue& value ) -{ - read_string_or_throw( s, value ); -} - -bool json_spirit::read( std::wistream& is, wmValue& value ) -{ - return read_stream( is, value ); -} - -void json_spirit::read_or_throw( std::wistream& is, wmValue& value ) -{ - read_stream_or_throw( is, value ); -} - -bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) -{ - return read_range( begin, end, value ); -} - -void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) -{ - begin = read_range_or_throw( begin, end, value ); -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader_template.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader_template.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_reader_template.h +++ /dev/null @@ -1,612 +0,0 @@ -#ifndef JSON_SPIRIT_READER_TEMPLATE -#define JSON_SPIRIT_READER_TEMPLATE - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#include "json_spirit_value.h" -#include "json_spirit_error_position.h" - -//#define BOOST_SPIRIT_THREADSAFE // uncomment for multithreaded use, requires linking to boost.thread - -#include -#include -#include - -#if BOOST_VERSION >= 103800 - #include - #include - #include - #include - #include - #define spirit_namespace boost::spirit::classic -#else - #include - #include - #include - #include - #include - #define spirit_namespace boost::spirit -#endif - -namespace json_spirit -{ - const spirit_namespace::int_parser < boost::int64_t > int64_p = spirit_namespace::int_parser < boost::int64_t >(); - const spirit_namespace::uint_parser< boost::uint64_t > uint64_p = spirit_namespace::uint_parser< boost::uint64_t >(); - - template< class Iter_type > - bool is_eq( Iter_type first, Iter_type last, const char* c_str ) - { - for( Iter_type i = first; i != last; ++i, ++c_str ) - { - if( *c_str == 0 ) return false; - - if( *i != *c_str ) return false; - } - - return true; - } - - template< class Char_type > - Char_type hex_to_num( const Char_type c ) - { - if( ( c >= '0' ) && ( c <= '9' ) ) return c - '0'; - if( ( c >= 'a' ) && ( c <= 'f' ) ) return c - 'a' + 10; - if( ( c >= 'A' ) && ( c <= 'F' ) ) return c - 'A' + 10; - return 0; - } - - template< class Char_type, class Iter_type > - Char_type hex_str_to_char( Iter_type& begin ) - { - const Char_type c1( *( ++begin ) ); - const Char_type c2( *( ++begin ) ); - - return ( hex_to_num( c1 ) << 4 ) + hex_to_num( c2 ); - } - - template< class Char_type, class Iter_type > - Char_type unicode_str_to_char( Iter_type& begin ) - { - const Char_type c1( *( ++begin ) ); - const Char_type c2( *( ++begin ) ); - const Char_type c3( *( ++begin ) ); - const Char_type c4( *( ++begin ) ); - - return ( hex_to_num( c1 ) << 12 ) + - ( hex_to_num( c2 ) << 8 ) + - ( hex_to_num( c3 ) << 4 ) + - hex_to_num( c4 ); - } - - template< class String_type > - void append_esc_char_and_incr_iter( String_type& s, - typename String_type::const_iterator& begin, - typename String_type::const_iterator end ) - { - typedef typename String_type::value_type Char_type; - - const Char_type c2( *begin ); - - switch( c2 ) - { - case 't': s += '\t'; break; - case 'b': s += '\b'; break; - case 'f': s += '\f'; break; - case 'n': s += '\n'; break; - case 'r': s += '\r'; break; - case '\\': s += '\\'; break; - case '/': s += '/'; break; - case '"': s += '"'; break; - case 'x': - { - if( end - begin >= 3 ) // expecting "xHH..." - { - s += hex_str_to_char< Char_type >( begin ); - } - break; - } - case 'u': - { - if( end - begin >= 5 ) // expecting "uHHHH..." - { - s += unicode_str_to_char< Char_type >( begin ); - } - break; - } - } - } - - template< class String_type > - String_type substitute_esc_chars( typename String_type::const_iterator begin, - typename String_type::const_iterator end ) - { - typedef typename String_type::const_iterator Iter_type; - - if( end - begin < 2 ) return String_type( begin, end ); - - String_type result; - - result.reserve( end - begin ); - - const Iter_type end_minus_1( end - 1 ); - - Iter_type substr_start = begin; - Iter_type i = begin; - - for( ; i < end_minus_1; ++i ) - { - if( *i == '\\' ) - { - result.append( substr_start, i ); - - ++i; // skip the '\' - - append_esc_char_and_incr_iter( result, i, end ); - - substr_start = i + 1; - } - } - - result.append( substr_start, end ); - - return result; - } - - template< class String_type > - String_type get_str_( typename String_type::const_iterator begin, - typename String_type::const_iterator end ) - { - assert( end - begin >= 2 ); - - typedef typename String_type::const_iterator Iter_type; - - Iter_type str_without_quotes( ++begin ); - Iter_type end_without_quotes( --end ); - - return substitute_esc_chars< String_type >( str_without_quotes, end_without_quotes ); - } - - inline std::string get_str( std::string::const_iterator begin, std::string::const_iterator end ) - { - return get_str_< std::string >( begin, end ); - } - - inline std::wstring get_str( std::wstring::const_iterator begin, std::wstring::const_iterator end ) - { - return get_str_< std::wstring >( begin, end ); - } - - template< class String_type, class Iter_type > - String_type get_str( Iter_type begin, Iter_type end ) - { - const String_type tmp( begin, end ); // convert multipass iterators to string iterators - - return get_str( tmp.begin(), tmp.end() ); - } - - // this class's methods get called by the spirit parse resulting - // in the creation of a JSON object or array - // - // NB Iter_type could be a std::string iterator, wstring iterator, a position iterator or a multipass iterator - // - template< class Value_type, class Iter_type > - class Semantic_actions - { - public: - - typedef typename Value_type::Config_type Config_type; - typedef typename Config_type::String_type String_type; - typedef typename Config_type::Object_type Object_type; - typedef typename Config_type::Array_type Array_type; - typedef typename String_type::value_type Char_type; - - Semantic_actions( Value_type& value ) - : value_( value ) - , current_p_( 0 ) - { - } - - void begin_obj( Char_type c ) - { - assert( c == '{' ); - - begin_compound< Object_type >(); - } - - void end_obj( Char_type c ) - { - assert( c == '}' ); - - end_compound(); - } - - void begin_array( Char_type c ) - { - assert( c == '[' ); - - begin_compound< Array_type >(); - } - - void end_array( Char_type c ) - { - assert( c == ']' ); - - end_compound(); - } - - void new_name( Iter_type begin, Iter_type end ) - { - assert( current_p_->type() == obj_type ); - - name_ = get_str< String_type >( begin, end ); - } - - void new_str( Iter_type begin, Iter_type end ) - { - add_to_current( get_str< String_type >( begin, end ) ); - } - - void new_true( Iter_type begin, Iter_type end ) - { - assert( is_eq( begin, end, "true" ) ); - - add_to_current( true ); - } - - void new_false( Iter_type begin, Iter_type end ) - { - assert( is_eq( begin, end, "false" ) ); - - add_to_current( false ); - } - - void new_null( Iter_type begin, Iter_type end ) - { - assert( is_eq( begin, end, "null" ) ); - - add_to_current( Value_type() ); - } - - void new_int( boost::int64_t i ) - { - add_to_current( i ); - } - - void new_uint64( boost::uint64_t ui ) - { - add_to_current( ui ); - } - - void new_real( double d ) - { - add_to_current( d ); - } - - private: - - Semantic_actions& operator=( const Semantic_actions& ); - // to prevent "assignment operator could not be generated" warning - - Value_type* add_first( const Value_type& value ) - { - assert( current_p_ == 0 ); - - value_ = value; - current_p_ = &value_; - return current_p_; - } - - template< class Array_or_obj > - void begin_compound() - { - if( current_p_ == 0 ) - { - add_first( Array_or_obj() ); - } - else - { - stack_.push_back( current_p_ ); - - Array_or_obj new_array_or_obj; // avoid copy by building new array or object in place - - current_p_ = add_to_current( new_array_or_obj ); - } - } - - void end_compound() - { - if( current_p_ != &value_ ) - { - current_p_ = stack_.back(); - - stack_.pop_back(); - } - } - - Value_type* add_to_current( const Value_type& value ) - { - if( current_p_ == 0 ) - { - return add_first( value ); - } - else if( current_p_->type() == array_type ) - { - current_p_->get_array().push_back( value ); - - return ¤t_p_->get_array().back(); - } - - assert( current_p_->type() == obj_type ); - - return &Config_type::add( current_p_->get_obj(), name_, value ); - } - - Value_type& value_; // this is the object or array that is being created - Value_type* current_p_; // the child object or array that is currently being constructed - - std::vector< Value_type* > stack_; // previous child objects and arrays - - String_type name_; // of current name/value pair - }; - - template< typename Iter_type > - void throw_error( spirit_namespace::position_iterator< Iter_type > i, const std::string& reason ) - { - throw Error_position( i.get_position().line, i.get_position().column, reason ); - } - - template< typename Iter_type > - void throw_error( Iter_type i, const std::string& reason ) - { - throw reason; - } - - // the spirit grammer - // - template< class Value_type, class Iter_type > - class Json_grammer : public spirit_namespace::grammar< Json_grammer< Value_type, Iter_type > > - { - public: - - typedef Semantic_actions< Value_type, Iter_type > Semantic_actions_t; - - Json_grammer( Semantic_actions_t& semantic_actions ) - : actions_( semantic_actions ) - { - } - - static void throw_not_value( Iter_type begin, Iter_type end ) - { - throw_error( begin, "not a value" ); - } - - static void throw_not_array( Iter_type begin, Iter_type end ) - { - throw_error( begin, "not an array" ); - } - - static void throw_not_object( Iter_type begin, Iter_type end ) - { - throw_error( begin, "not an object" ); - } - - static void throw_not_pair( Iter_type begin, Iter_type end ) - { - throw_error( begin, "not a pair" ); - } - - static void throw_not_colon( Iter_type begin, Iter_type end ) - { - throw_error( begin, "no colon in pair" ); - } - - static void throw_not_string( Iter_type begin, Iter_type end ) - { - throw_error( begin, "not a string" ); - } - - template< typename ScannerT > - class definition - { - public: - - definition( const Json_grammer& self ) - { - using namespace spirit_namespace; - - typedef typename Value_type::String_type::value_type Char_type; - - // first we convert the semantic action class methods to functors with the - // parameter signature expected by spirit - - typedef boost::function< void( Char_type ) > Char_action; - typedef boost::function< void( Iter_type, Iter_type ) > Str_action; - typedef boost::function< void( double ) > Real_action; - typedef boost::function< void( boost::int64_t ) > Int_action; - typedef boost::function< void( boost::uint64_t ) > Uint64_action; - - Char_action begin_obj ( boost::bind( &Semantic_actions_t::begin_obj, &self.actions_, _1 ) ); - Char_action end_obj ( boost::bind( &Semantic_actions_t::end_obj, &self.actions_, _1 ) ); - Char_action begin_array( boost::bind( &Semantic_actions_t::begin_array, &self.actions_, _1 ) ); - Char_action end_array ( boost::bind( &Semantic_actions_t::end_array, &self.actions_, _1 ) ); - Str_action new_name ( boost::bind( &Semantic_actions_t::new_name, &self.actions_, _1, _2 ) ); - Str_action new_str ( boost::bind( &Semantic_actions_t::new_str, &self.actions_, _1, _2 ) ); - Str_action new_true ( boost::bind( &Semantic_actions_t::new_true, &self.actions_, _1, _2 ) ); - Str_action new_false ( boost::bind( &Semantic_actions_t::new_false, &self.actions_, _1, _2 ) ); - Str_action new_null ( boost::bind( &Semantic_actions_t::new_null, &self.actions_, _1, _2 ) ); - Real_action new_real ( boost::bind( &Semantic_actions_t::new_real, &self.actions_, _1 ) ); - Int_action new_int ( boost::bind( &Semantic_actions_t::new_int, &self.actions_, _1 ) ); - Uint64_action new_uint64 ( boost::bind( &Semantic_actions_t::new_uint64, &self.actions_, _1 ) ); - - // actual grammer - - json_ - = value_ | eps_p[ &throw_not_value ] - ; - - value_ - = string_[ new_str ] - | number_ - | object_ - | array_ - | str_p( "true" ) [ new_true ] - | str_p( "false" )[ new_false ] - | str_p( "null" ) [ new_null ] - ; - - object_ - = ch_p('{')[ begin_obj ] - >> !members_ - >> ( ch_p('}')[ end_obj ] | eps_p[ &throw_not_object ] ) - ; - - members_ - = pair_ >> *( ',' >> pair_ ) - ; - - pair_ - = string_[ new_name ] - >> ( ':' | eps_p[ &throw_not_colon ] ) - >> ( value_ | eps_p[ &throw_not_value ] ) - ; - - array_ - = ch_p('[')[ begin_array ] - >> !elements_ - >> ( ch_p(']')[ end_array ] | eps_p[ &throw_not_array ] ) - ; - - elements_ - = value_ >> *( ',' >> value_ ) - ; - - string_ - = lexeme_d // this causes white space inside a string to be retained - [ - confix_p - ( - '"', - *lex_escape_ch_p, - '"' - ) - ] - ; - - number_ - = strict_real_p[ new_real ] - | int64_p [ new_int ] - | uint64_p [ new_uint64 ] - ; - } - - spirit_namespace::rule< ScannerT > json_, object_, members_, pair_, array_, elements_, value_, string_, number_; - - const spirit_namespace::rule< ScannerT >& start() const { return json_; } - }; - - private: - - Json_grammer& operator=( const Json_grammer& ); // to prevent "assignment operator could not be generated" warning - - Semantic_actions_t& actions_; - }; - - template< class Iter_type, class Value_type > - Iter_type read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value ) - { - Semantic_actions< Value_type, Iter_type > semantic_actions( value ); - - const spirit_namespace::parse_info< Iter_type > info = - spirit_namespace::parse( begin, end, - Json_grammer< Value_type, Iter_type >( semantic_actions ), - spirit_namespace::space_p ); - - if( !info.hit ) - { - assert( false ); // in theory exception should already have been thrown - throw_error( info.stop, "error" ); - } - - return info.stop; - } - - template< class Iter_type, class Value_type > - void add_posn_iter_and_read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value ) - { - typedef spirit_namespace::position_iterator< Iter_type > Posn_iter_t; - - const Posn_iter_t posn_begin( begin, end ); - const Posn_iter_t posn_end( end, end ); - - read_range_or_throw( posn_begin, posn_end, value ); - } - - template< class Iter_type, class Value_type > - bool read_range( Iter_type& begin, Iter_type end, Value_type& value ) - { - try - { - begin = read_range_or_throw( begin, end, value ); - - return true; - } - catch( ... ) - { - return false; - } - } - - template< class String_type, class Value_type > - void read_string_or_throw( const String_type& s, Value_type& value ) - { - add_posn_iter_and_read_range_or_throw( s.begin(), s.end(), value ); - } - - template< class String_type, class Value_type > - bool read_string( const String_type& s, Value_type& value ) - { - typename String_type::const_iterator begin = s.begin(); - - return read_range( begin, s.end(), value ); - } - - template< class Istream_type > - struct Multi_pass_iters - { - typedef typename Istream_type::char_type Char_type; - typedef std::istream_iterator< Char_type, Char_type > istream_iter; - typedef spirit_namespace::multi_pass< istream_iter > Mp_iter; - - Multi_pass_iters( Istream_type& is ) - { - is.unsetf( std::ios::skipws ); - - begin_ = spirit_namespace::make_multi_pass( istream_iter( is ) ); - end_ = spirit_namespace::make_multi_pass( istream_iter() ); - } - - Mp_iter begin_; - Mp_iter end_; - }; - - template< class Istream_type, class Value_type > - bool read_stream( Istream_type& is, Value_type& value ) - { - Multi_pass_iters< Istream_type > mp_iters( is ); - - return read_range( mp_iters.begin_, mp_iters.end_, value ); - } - - template< class Istream_type, class Value_type > - void read_stream_or_throw( Istream_type& is, Value_type& value ) - { - const Multi_pass_iters< Istream_type > mp_iters( is ); - - add_posn_iter_and_read_range_or_throw( mp_iters.begin_, mp_iters.end_, value ); - } -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_stream_reader.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_stream_reader.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_stream_reader.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef JSON_SPIRIT_READ_STREAM -#define JSON_SPIRIT_READ_STREAM - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -#include "json_spirit_reader_template.h" - -namespace json_spirit -{ - // these classes allows you to read multiple top level contiguous values from a stream, - // the normal stream read functions have a bug that prevent multiple top level values - // from being read unless they are separated by spaces - - template< class Istream_type, class Value_type > - class Stream_reader - { - public: - - Stream_reader( Istream_type& is ) - : iters_( is ) - { - } - - bool read_next( Value_type& value ) - { - return read_range( iters_.begin_, iters_.end_, value ); - } - - private: - - typedef Multi_pass_iters< Istream_type > Mp_iters; - - Mp_iters iters_; - }; - - template< class Istream_type, class Value_type > - class Stream_reader_thrower - { - public: - - Stream_reader_thrower( Istream_type& is ) - : iters_( is ) - , posn_begin_( iters_.begin_, iters_.end_ ) - , posn_end_( iters_.end_, iters_.end_ ) - { - } - - void read_next( Value_type& value ) - { - posn_begin_ = read_range_or_throw( posn_begin_, posn_end_, value ); - } - - private: - - typedef Multi_pass_iters< Istream_type > Mp_iters; - typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t; - - Mp_iters iters_; - Posn_iter_t posn_begin_, posn_end_; - }; -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_utils.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_utils.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_utils.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef JSON_SPIRIT_UTILS -#define JSON_SPIRIT_UTILS - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -#include "json_spirit_value.h" -#include - -namespace json_spirit -{ - template< class Obj_t, class Map_t > - void obj_to_map( const Obj_t& obj, Map_t& mp_obj ) - { - mp_obj.clear(); - - for( typename Obj_t::const_iterator i = obj.begin(); i != obj.end(); ++i ) - { - mp_obj[ i->name_ ] = i->value_; - } - } - - template< class Obj_t, class Map_t > - void map_to_obj( const Map_t& mp_obj, Obj_t& obj ) - { - obj.clear(); - - for( typename Map_t::const_iterator i = mp_obj.begin(); i != mp_obj.end(); ++i ) - { - obj.push_back( typename Obj_t::value_type( i->first, i->second ) ); - } - } - - typedef std::map< std::string, Value > Mapped_obj; - -#ifndef BOOST_NO_STD_WSTRING - typedef std::map< std::wstring, wValue > wMapped_obj; -#endif - - template< class Object_type, class String_type > - const typename Object_type::value_type::Value_type& find_value( const Object_type& obj, const String_type& name ) - { - for( typename Object_type::const_iterator i = obj.begin(); i != obj.end(); ++i ) - { - if( i->name_ == name ) - { - return i->value_; - } - } - - return Object_type::value_type::Value_type::null; - } -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_value.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_value.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_value.h +++ /dev/null @@ -1,532 +0,0 @@ -#ifndef JSON_SPIRIT_VALUE -#define JSON_SPIRIT_VALUE - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace json_spirit -{ - enum Value_type{ obj_type, array_type, str_type, bool_type, int_type, real_type, null_type }; - - template< class Config > // Config determines whether the value uses std::string or std::wstring and - // whether JSON Objects are represented as vectors or maps - class Value_impl - { - public: - - typedef Config Config_type; - typedef typename Config::String_type String_type; - typedef typename Config::Object_type Object; - typedef typename Config::Array_type Array; - typedef typename String_type::const_pointer Const_str_ptr; // eg const char* - - Value_impl(); // creates null value - Value_impl( Const_str_ptr value ); - Value_impl( const String_type& value ); - Value_impl( const Object& value ); - Value_impl( const Array& value ); - Value_impl( bool value ); - Value_impl( int value ); - Value_impl( boost::int64_t value ); - Value_impl( boost::uint64_t value ); - Value_impl( double value ); - - Value_impl( const Value_impl& other ); - - bool operator==( const Value_impl& lhs ) const; - - Value_impl& operator=( const Value_impl& lhs ); - - Value_type type() const; - - bool is_uint64() const; - bool is_null() const; - - const String_type& get_str() const; - const Object& get_obj() const; - const Array& get_array() const; - bool get_bool() const; - int get_int() const; - boost::int64_t get_int64() const; - boost::uint64_t get_uint64() const; - double get_real() const; - - Object& get_obj(); - Array& get_array(); - - template< typename T > T get_value() const; // example usage: int i = value.get_value< int >(); - // or double d = value.get_value< double >(); - - static const Value_impl null; - - private: - - void check_type( const Value_type vtype ) const; - - typedef boost::variant< String_type, - boost::recursive_wrapper< Object >, boost::recursive_wrapper< Array >, - bool, boost::int64_t, double > Variant; - - Value_type type_; - Variant v_; - bool is_uint64_; - }; - - // vector objects - - template< class Config > - struct Pair_impl - { - typedef typename Config::String_type String_type; - typedef typename Config::Value_type Value_type; - - Pair_impl( const String_type& name, const Value_type& value ); - - bool operator==( const Pair_impl& lhs ) const; - - String_type name_; - Value_type value_; - }; - - template< class String > - struct Config_vector - { - typedef String String_type; - typedef Value_impl< Config_vector > Value_type; - typedef Pair_impl < Config_vector > Pair_type; - typedef std::vector< Value_type > Array_type; - typedef std::vector< Pair_type > Object_type; - - static Value_type& add( Object_type& obj, const String_type& name, const Value_type& value ) - { - obj.push_back( Pair_type( name , value ) ); - - return obj.back().value_; - } - - static String_type get_name( const Pair_type& pair ) - { - return pair.name_; - } - - static Value_type get_value( const Pair_type& pair ) - { - return pair.value_; - } - }; - - // typedefs for ASCII - - typedef Config_vector< std::string > Config; - - typedef Config::Value_type Value; - typedef Config::Pair_type Pair; - typedef Config::Object_type Object; - typedef Config::Array_type Array; - - // typedefs for Unicode - -#ifndef BOOST_NO_STD_WSTRING - - typedef Config_vector< std::wstring > wConfig; - - typedef wConfig::Value_type wValue; - typedef wConfig::Pair_type wPair; - typedef wConfig::Object_type wObject; - typedef wConfig::Array_type wArray; -#endif - - // map objects - - template< class String > - struct Config_map - { - typedef String String_type; - typedef Value_impl< Config_map > Value_type; - typedef std::vector< Value_type > Array_type; - typedef std::map< String_type, Value_type > Object_type; - typedef typename Object_type::value_type Pair_type; - - static Value_type& add( Object_type& obj, const String_type& name, const Value_type& value ) - { - return obj[ name ] = value; - } - - static String_type get_name( const Pair_type& pair ) - { - return pair.first; - } - - static Value_type get_value( const Pair_type& pair ) - { - return pair.second; - } - }; - - // typedefs for ASCII - - typedef Config_map< std::string > mConfig; - - typedef mConfig::Value_type mValue; - typedef mConfig::Object_type mObject; - typedef mConfig::Array_type mArray; - - // typedefs for Unicode - -#ifndef BOOST_NO_STD_WSTRING - - typedef Config_map< std::wstring > wmConfig; - - typedef wmConfig::Value_type wmValue; - typedef wmConfig::Object_type wmObject; - typedef wmConfig::Array_type wmArray; - -#endif - - /////////////////////////////////////////////////////////////////////////////////////////////// - // - // implementation - - template< class Config > - const Value_impl< Config > Value_impl< Config >::null; - - template< class Config > - Value_impl< Config >::Value_impl() - : type_( null_type ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( const Const_str_ptr value ) - : type_( str_type ) - , v_( String_type( value ) ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( const String_type& value ) - : type_( str_type ) - , v_( value ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( const Object& value ) - : type_( obj_type ) - , v_( value ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( const Array& value ) - : type_( array_type ) - , v_( value ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( bool value ) - : type_( bool_type ) - , v_( value ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( int value ) - : type_( int_type ) - , v_( static_cast< boost::int64_t >( value ) ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( boost::int64_t value ) - : type_( int_type ) - , v_( value ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( boost::uint64_t value ) - : type_( int_type ) - , v_( static_cast< boost::int64_t >( value ) ) - , is_uint64_( true ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( double value ) - : type_( real_type ) - , v_( value ) - , is_uint64_( false ) - { - } - - template< class Config > - Value_impl< Config >::Value_impl( const Value_impl< Config >& other ) - : type_( other.type() ) - , v_( other.v_ ) - , is_uint64_( other.is_uint64_ ) - { - } - - template< class Config > - Value_impl< Config >& Value_impl< Config >::operator=( const Value_impl& lhs ) - { - Value_impl tmp( lhs ); - - std::swap( type_, tmp.type_ ); - std::swap( v_, tmp.v_ ); - std::swap( is_uint64_, tmp.is_uint64_ ); - - return *this; - } - - template< class Config > - bool Value_impl< Config >::operator==( const Value_impl& lhs ) const - { - if( this == &lhs ) return true; - - if( type() != lhs.type() ) return false; - - return v_ == lhs.v_; - } - - template< class Config > - Value_type Value_impl< Config >::type() const - { - return type_; - } - - template< class Config > - bool Value_impl< Config >::is_uint64() const - { - return is_uint64_; - } - - template< class Config > - bool Value_impl< Config >::is_null() const - { - return type() == null_type; - } - - template< class Config > - void Value_impl< Config >::check_type( const Value_type vtype ) const - { - if( type() != vtype ) - { - std::ostringstream os; - - os << "value type is " << type() << " not " << vtype; - - throw std::runtime_error( os.str() ); - } - } - - template< class Config > - const typename Config::String_type& Value_impl< Config >::get_str() const - { - check_type( str_type ); - - return *boost::get< String_type >( &v_ ); - } - - template< class Config > - const typename Value_impl< Config >::Object& Value_impl< Config >::get_obj() const - { - check_type( obj_type ); - - return *boost::get< Object >( &v_ ); - } - - template< class Config > - const typename Value_impl< Config >::Array& Value_impl< Config >::get_array() const - { - check_type( array_type ); - - return *boost::get< Array >( &v_ ); - } - - template< class Config > - bool Value_impl< Config >::get_bool() const - { - check_type( bool_type ); - - return boost::get< bool >( v_ ); - } - - template< class Config > - int Value_impl< Config >::get_int() const - { - check_type( int_type ); - - return static_cast< int >( get_int64() ); - } - - template< class Config > - boost::int64_t Value_impl< Config >::get_int64() const - { - check_type( int_type ); - - return boost::get< boost::int64_t >( v_ ); - } - - template< class Config > - boost::uint64_t Value_impl< Config >::get_uint64() const - { - check_type( int_type ); - - return static_cast< boost::uint64_t >( get_int64() ); - } - - template< class Config > - double Value_impl< Config >::get_real() const - { - if( type() == int_type ) - { - return is_uint64() ? static_cast< double >( get_uint64() ) - : static_cast< double >( get_int64() ); - } - - check_type( real_type ); - - return boost::get< double >( v_ ); - } - - template< class Config > - typename Value_impl< Config >::Object& Value_impl< Config >::get_obj() - { - check_type( obj_type ); - - return *boost::get< Object >( &v_ ); - } - - template< class Config > - typename Value_impl< Config >::Array& Value_impl< Config >::get_array() - { - check_type( array_type ); - - return *boost::get< Array >( &v_ ); - } - - template< class Config > - Pair_impl< Config >::Pair_impl( const String_type& name, const Value_type& value ) - : name_( name ) - , value_( value ) - { - } - - template< class Config > - bool Pair_impl< Config >::operator==( const Pair_impl< Config >& lhs ) const - { - if( this == &lhs ) return true; - - return ( name_ == lhs.name_ ) && ( value_ == lhs.value_ ); - } - - // converts a C string, ie. 8 bit char array, to a string object - // - template < class String_type > - String_type to_str( const char* c_str ) - { - String_type result; - - for( const char* p = c_str; *p != 0; ++p ) - { - result += *p; - } - - return result; - } - - // - - namespace internal_ - { - template< typename T > - struct Type_to_type - { - }; - - template< class Value > - int get_value( const Value& value, Type_to_type< int > ) - { - return value.get_int(); - } - - template< class Value > - boost::int64_t get_value( const Value& value, Type_to_type< boost::int64_t > ) - { - return value.get_int64(); - } - - template< class Value > - boost::uint64_t get_value( const Value& value, Type_to_type< boost::uint64_t > ) - { - return value.get_uint64(); - } - - template< class Value > - double get_value( const Value& value, Type_to_type< double > ) - { - return value.get_real(); - } - - template< class Value > - typename Value::String_type get_value( const Value& value, Type_to_type< typename Value::String_type > ) - { - return value.get_str(); - } - - template< class Value > - typename Value::Array get_value( const Value& value, Type_to_type< typename Value::Array > ) - { - return value.get_array(); - } - - template< class Value > - typename Value::Object get_value( const Value& value, Type_to_type< typename Value::Object > ) - { - return value.get_obj(); - } - - template< class Value > - bool get_value( const Value& value, Type_to_type< bool > ) - { - return value.get_bool(); - } - } - - template< class Config > - template< typename T > - T Value_impl< Config >::get_value() const - { - return internal_::get_value( *this, internal_::Type_to_type< T >() ); - } -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_value.cpp b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_value.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_value.cpp +++ /dev/null @@ -1,8 +0,0 @@ -/* Copyright (c) 2007 John W Wilkinson - - This source code can be used for any purpose as long as - this comment is retained. */ - -// json spirit version 2.00 - -#include "json_spirit_value.h" diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef JSON_SPIRIT_WRITER -#define JSON_SPIRIT_WRITER - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -#include "json_spirit_value.h" -#include - -namespace json_spirit -{ - // functions to convert JSON Values to text, - // the "formatted" versions add whitespace to format the output nicely - - void write ( const Value& value, std::ostream& os ); - void write_formatted( const Value& value, std::ostream& os ); - std::string write ( const Value& value ); - std::string write_formatted( const Value& value ); - -#ifndef BOOST_NO_STD_WSTRING - - void write ( const wValue& value, std::wostream& os ); - void write_formatted( const wValue& value, std::wostream& os ); - std::wstring write ( const wValue& value ); - std::wstring write_formatted( const wValue& value ); - -#endif - - void write ( const mValue& value, std::ostream& os ); - void write_formatted( const mValue& value, std::ostream& os ); - std::string write ( const mValue& value ); - std::string write_formatted( const mValue& value ); - -#ifndef BOOST_NO_STD_WSTRING - - void write ( const wmValue& value, std::wostream& os ); - void write_formatted( const wmValue& value, std::wostream& os ); - std::wstring write ( const wmValue& value ); - std::wstring write_formatted( const wmValue& value ); - -#endif -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer.cpp b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#include "json_spirit_writer.h" -#include "json_spirit_writer_template.h" - -void json_spirit::write( const Value& value, std::ostream& os ) -{ - write_stream( value, os, false ); -} - -void json_spirit::write_formatted( const Value& value, std::ostream& os ) -{ - write_stream( value, os, true ); -} - -std::string json_spirit::write( const Value& value ) -{ - return write_string( value, false ); -} - -std::string json_spirit::write_formatted( const Value& value ) -{ - return write_string( value, true ); -} - -#ifndef BOOST_NO_STD_WSTRING - -void json_spirit::write( const wValue& value, std::wostream& os ) -{ - write_stream( value, os, false ); -} - -void json_spirit::write_formatted( const wValue& value, std::wostream& os ) -{ - write_stream( value, os, true ); -} - -std::wstring json_spirit::write( const wValue& value ) -{ - return write_string( value, false ); -} - -std::wstring json_spirit::write_formatted( const wValue& value ) -{ - return write_string( value, true ); -} - -#endif - -void json_spirit::write( const mValue& value, std::ostream& os ) -{ - write_stream( value, os, false ); -} - -void json_spirit::write_formatted( const mValue& value, std::ostream& os ) -{ - write_stream( value, os, true ); -} - -std::string json_spirit::write( const mValue& value ) -{ - return write_string( value, false ); -} - -std::string json_spirit::write_formatted( const mValue& value ) -{ - return write_string( value, true ); -} - -#ifndef BOOST_NO_STD_WSTRING - -void json_spirit::write( const wmValue& value, std::wostream& os ) -{ - write_stream( value, os, false ); -} - -void json_spirit::write_formatted( const wmValue& value, std::wostream& os ) -{ - write_stream( value, os, true ); -} - -std::wstring json_spirit::write( const wmValue& value ) -{ - return write_string( value, false ); -} - -std::wstring json_spirit::write_formatted( const wmValue& value ) -{ - return write_string( value, true ); -} - -#endif diff --git a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer_template.h b/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer_template.h deleted file mode 100644 --- a/3rdparty/cucumber-cpp/include/json_spirit/json_spirit_writer_template.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef JSON_SPIRIT_WRITER_TEMPLATE -#define JSON_SPIRIT_WRITER_TEMPLATE - -// Copyright John W. Wilkinson 2007 - 2009. -// Distributed under the MIT License, see accompanying file LICENSE.txt - -// json spirit version 4.03 - -#include "json_spirit_value.h" - -#include -#include -#include - -namespace json_spirit -{ - inline char to_hex_char( unsigned int c ) - { - assert( c <= 0xF ); - - const char ch = static_cast< char >( c ); - - if( ch < 10 ) return '0' + ch; - - return 'A' - 10 + ch; - } - - template< class String_type > - String_type non_printable_to_string( unsigned int c ) - { - typedef typename String_type::value_type Char_type; - - String_type result( 6, '\\' ); - - result[1] = 'u'; - - result[ 5 ] = to_hex_char( c & 0x000F ); c >>= 4; - result[ 4 ] = to_hex_char( c & 0x000F ); c >>= 4; - result[ 3 ] = to_hex_char( c & 0x000F ); c >>= 4; - result[ 2 ] = to_hex_char( c & 0x000F ); - - return result; - } - - template< typename Char_type, class String_type > - bool add_esc_char( Char_type c, String_type& s ) - { - switch( c ) - { - case '"': s += to_str< String_type >( "\\\"" ); return true; - case '\\': s += to_str< String_type >( "\\\\" ); return true; - case '\b': s += to_str< String_type >( "\\b" ); return true; - case '\f': s += to_str< String_type >( "\\f" ); return true; - case '\n': s += to_str< String_type >( "\\n" ); return true; - case '\r': s += to_str< String_type >( "\\r" ); return true; - case '\t': s += to_str< String_type >( "\\t" ); return true; - } - - return false; - } - - template< class String_type > - String_type add_esc_chars( const String_type& s ) - { - typedef typename String_type::const_iterator Iter_type; - typedef typename String_type::value_type Char_type; - - String_type result; - - const Iter_type end( s.end() ); - - for( Iter_type i = s.begin(); i != end; ++i ) - { - const Char_type c( *i ); - - if( add_esc_char( c, result ) ) continue; - - const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c ); - - if( iswprint( unsigned_c ) ) - { - result += c; - } - else - { - result += non_printable_to_string< String_type >( unsigned_c ); - } - } - - return result; - } - - // this class generates the JSON text, - // it keeps track of the indentation level etc. - // - template< class Value_type, class Ostream_type > - class Generator - { - typedef typename Value_type::Config_type Config_type; - typedef typename Config_type::String_type String_type; - typedef typename Config_type::Object_type Object_type; - typedef typename Config_type::Array_type Array_type; - typedef typename String_type::value_type Char_type; - typedef typename Object_type::value_type Obj_member_type; - - public: - - Generator( const Value_type& value, Ostream_type& os, bool pretty ) - : os_( os ) - , indentation_level_( 0 ) - , pretty_( pretty ) - { - output( value ); - } - - private: - - void output( const Value_type& value ) - { - switch( value.type() ) - { - case obj_type: output( value.get_obj() ); break; - case array_type: output( value.get_array() ); break; - case str_type: output( value.get_str() ); break; - case bool_type: output( value.get_bool() ); break; - case int_type: output_int( value ); break; - case real_type: os_ << std::showpoint << std::setprecision( 16 ) - << value.get_real(); break; - case null_type: os_ << "null"; break; - default: assert( false ); - } - } - - void output( const Object_type& obj ) - { - output_array_or_obj( obj, '{', '}' ); - } - - void output( const Array_type& arr ) - { - output_array_or_obj( arr, '[', ']' ); - } - - void output( const Obj_member_type& member ) - { - output( Config_type::get_name( member ) ); space(); - os_ << ':'; space(); - output( Config_type::get_value( member ) ); - } - - void output_int( const Value_type& value ) - { - if( value.is_uint64() ) - { - os_ << value.get_uint64(); - } - else - { - os_ << value.get_int64(); - } - } - - void output( const String_type& s ) - { - os_ << '"' << add_esc_chars( s ) << '"'; - } - - void output( bool b ) - { - os_ << to_str< String_type >( b ? "true" : "false" ); - } - - template< class T > - void output_array_or_obj( const T& t, Char_type start_char, Char_type end_char ) - { - os_ << start_char; new_line(); - - ++indentation_level_; - - for( typename T::const_iterator i = t.begin(); i != t.end(); ++i ) - { - indent(); output( *i ); - - typename T::const_iterator next = i; - - if( ++next != t.end()) - { - os_ << ','; - } - - new_line(); - } - - --indentation_level_; - - indent(); os_ << end_char; - } - - void indent() - { - if( !pretty_ ) return; - - for( int i = 0; i < indentation_level_; ++i ) - { - os_ << " "; - } - } - - void space() - { - if( pretty_ ) os_ << ' '; - } - - void new_line() - { - if( pretty_ ) os_ << '\n'; - } - - Generator& operator=( const Generator& ); // to prevent "assignment operator could not be generated" warning - - Ostream_type& os_; - int indentation_level_; - bool pretty_; - }; - - template< class Value_type, class Ostream_type > - void write_stream( const Value_type& value, Ostream_type& os, bool pretty ) - { - Generator< Value_type, Ostream_type >( value, os, pretty ); - } - - template< class Value_type > - typename Value_type::String_type write_string( const Value_type& value, bool pretty ) - { - typedef typename Value_type::String_type::value_type Char_type; - - std::basic_ostringstream< Char_type > os; - - write_stream( value, os, pretty ); - - return os.str(); - } -} - -#endif diff --git a/3rdparty/cucumber-cpp/src/CMakeLists.txt b/3rdparty/cucumber-cpp/src/CMakeLists.txt deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -set(CUKE_SOURCES - ContextManager.cpp - CukeCommands.cpp - CukeEngine.cpp - CukeEngineImpl.cpp - StepManager.cpp - HookRegistrar.cpp - Regex.cpp - Scenario.cpp - Table.cpp - Tag.cpp - connectors/wire/WireServer.cpp - connectors/wire/WireProtocol.cpp - connectors/wire/WireProtocolCommands.cpp -) - -if(GTEST_FOUND) - include_directories(${GTEST_INCLUDE_DIRS}) - list(APPEND CUKE_SOURCES drivers/GTestDriver.cpp) -endif() - -if(CPPSPEC_FOUND) - include_directories(${CPPSPEC_INCLUDE_DIRS}) - list(APPEND CUKE_SOURCES drivers/CppSpecDriver.cpp) -endif() - -if(Boost_UNIT_TEST_FRAMEWORK_FOUND) - list(APPEND CUKE_SOURCES drivers/BoostDriver.cpp) -endif() - -if(CMAKE_EXTRA_GENERATOR OR MSVC_IDE) - message(STATUS "Adding header files to project") - file(GLOB_RECURSE CUKE_HEADERS "${CUKE_INCLUDE_DIR}/cucumber-cpp/*.hpp") - if(MSVC_IDE) - source_group("Header Files" FILES ${CUKE_HEADERS}) - endif() - list(APPEND CUKE_SOURCES ${CUKE_HEADERS}) -endif() - -kde_enable_exceptions() -add_library(cucumber-cpp-nomain STATIC ${CUKE_SOURCES}) -add_library(cucumber-cpp STATIC ${CUKE_SOURCES} main.cpp) - diff --git a/3rdparty/cucumber-cpp/src/ContextManager.cpp b/3rdparty/cucumber-cpp/src/ContextManager.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/ContextManager.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "cucumber-cpp/internal/ContextManager.hpp" - -namespace cucumber { -namespace internal { - -contexts_type ContextManager::contexts; - -void ContextManager::purgeContexts() { - contexts.clear(); -} - -} -} - diff --git a/3rdparty/cucumber-cpp/src/CukeCommands.cpp b/3rdparty/cucumber-cpp/src/CukeCommands.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/CukeCommands.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "cucumber-cpp/internal/CukeCommands.hpp" - -#include -#include - -namespace cucumber { -namespace internal { - -shared_ptr CukeCommands::currentScenario; - -CukeCommands::CukeCommands() : hasStarted(false) { -} - -CukeCommands::~CukeCommands() { - if (hasStarted) { - hookRegistrar.execAfterAllHooks(); - } -} - -void CukeCommands::beginScenario(const TagExpression::tag_list *tags) { - if (!hasStarted) { - hasStarted = true; - hookRegistrar.execBeforeAllHooks(); - } - - currentScenario = shared_ptr(new Scenario(tags)); - hookRegistrar.execBeforeHooks(currentScenario.get()); -} - -void CukeCommands::endScenario() { - hookRegistrar.execAfterHooks(currentScenario.get()); - contextManager.purgeContexts(); - currentScenario.reset(); -} - -const std::string CukeCommands::snippetText(const std::string stepKeyword, const std::string stepName) const { - std::stringstream snippetText; // TODO Escape stepName - snippetText << boost::to_upper_copy(stepKeyword) << "(\"^" << stepName << "$\") {" << std::endl; - snippetText << " pending();" << std::endl; - snippetText << "}" << std::endl; - return snippetText.str(); -} - -MatchResult CukeCommands::stepMatches(const std::string description) const { - return stepManager.stepMatches(description); -} - -InvokeResult CukeCommands::invoke(step_id_type id, const InvokeArgs *pArgs) { - StepInfo *stepInfo = stepManager.getStep(id); - InvokeResult result = hookRegistrar.execStepChain(currentScenario.get(), stepInfo, pArgs); - hookRegistrar.execAfterStepHooks(currentScenario.get()); - return result; -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/CukeEngine.cpp b/3rdparty/cucumber-cpp/src/CukeEngine.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/CukeEngine.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "cucumber-cpp/internal/CukeEngine.hpp" - -namespace cucumber { -namespace internal { - -InvokeException::InvokeException(const std::string & message) : - message(message) { -} - -InvokeException::InvokeException(const InvokeException &rhs) : - message(rhs.message) { -} - -const std::string InvokeException::getMessage() const { - return message; -} - - -InvokeFailureException::InvokeFailureException(const std::string & message, const std::string & exceptionType) : - InvokeException(message), - exceptionType(exceptionType) { -} - -InvokeFailureException::InvokeFailureException(const InvokeFailureException &rhs) : - InvokeException(rhs), - exceptionType(rhs.exceptionType) { -} - -const std::string InvokeFailureException::getExceptionType() const { - return exceptionType; -} - - -PendingStepException::PendingStepException(const std::string & message) : - InvokeException(message) { -} - -PendingStepException::PendingStepException(const PendingStepException &rhs) : - InvokeException(rhs) { -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/CukeEngineImpl.cpp b/3rdparty/cucumber-cpp/src/CukeEngineImpl.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/CukeEngineImpl.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "cucumber-cpp/internal/CukeEngineImpl.hpp" - -#include - -namespace cucumber { -namespace internal { - -namespace { - - std::string convertId(step_id_type id) { - std::stringstream ss; - ss << id; - return ss.str(); - } - - step_id_type convertId(const std::string & stringid) { - std::stringstream ss(stringid); - step_id_type id; - ss >> id; - return id; - } -} - -std::vector CukeEngineImpl::stepMatches(const std::string & name) const { - std::vector engineResult; - MatchResult commandResult = cukeCommands.stepMatches(name); - BOOST_FOREACH(const SingleStepMatch commandMatch, commandResult.getResultSet()) { - StepMatch engineMatch; - engineMatch.id = convertId(commandMatch.stepInfo->id); - engineMatch.source = commandMatch.stepInfo->source; - engineMatch.regexp = commandMatch.stepInfo->regex.str(); - BOOST_FOREACH(const RegexSubmatch commandMatchArg, commandMatch.submatches) { - StepMatchArg engineMatchArg; - engineMatchArg.value = commandMatchArg.value; - engineMatchArg.position = commandMatchArg.position; - engineMatch.args.push_back(engineMatchArg); - } - engineResult.push_back(engineMatch); - } - return engineResult; -} - -void CukeEngineImpl::beginScenario(const tags_type & tags) { - cukeCommands.beginScenario(&tags); -} - -void CukeEngineImpl::invokeStep(const std::string & id, const invoke_args_type & args, const invoke_table_type & tableArg) { - typedef invoke_table_type::index table_index; - - InvokeArgs commandArgs; - try { - BOOST_FOREACH(const std::string a, args) { - commandArgs.addArg(a); - } - - if (tableArg.shape()[0] > 1 && tableArg.shape()[1] > 0) { - Table & commandTableArg = commandArgs.getVariableTableArg(); - for (table_index j = 0; j < tableArg.shape()[1]; ++j) { - commandTableArg.addColumn(tableArg[0][j]); - } - - for (table_index i = 1; i < tableArg.shape()[0]; ++i) { - Table::row_type row; - for (table_index j = 0; j < tableArg.shape()[1]; ++j) { - row.push_back(tableArg[i][j]); - } - commandTableArg.addRow(row); - } - } - } catch (...) { - throw InvokeException("Unable to decode arguments"); - } - - InvokeResult commandResult; - try { - commandResult = cukeCommands.invoke(convertId(id), &commandArgs); - } catch (...) { - throw InvokeException("Uncatched exception"); - } - switch (commandResult.getType()) { - case SUCCESS: - return; - case FAILURE: - throw InvokeFailureException(commandResult.getDescription(), ""); - case PENDING: - throw PendingStepException(commandResult.getDescription()); - } -} - -void CukeEngineImpl::endScenario(const tags_type & tags) { - cukeCommands.endScenario(); -} - -std::string CukeEngineImpl::snippetText(const std::string & keyword, const std::string & name, const std::string & multilineArgClass) const { - return cukeCommands.snippetText(keyword, name); -} - - -} -} diff --git a/3rdparty/cucumber-cpp/src/HookRegistrar.cpp b/3rdparty/cucumber-cpp/src/HookRegistrar.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/HookRegistrar.cpp +++ /dev/null @@ -1,177 +0,0 @@ -#include - -#include - -namespace cucumber { -namespace internal { - -void Hook::invokeHook(Scenario *scenario) { - if (tagsMatch(scenario)) { - body(); - } else { - skipHook(); - } -} - -void Hook::skipHook() { -} - -void Hook::setTags(const std::string &csvTagNotation) { - tagExpression = shared_ptr(new AndTagExpression(csvTagNotation)); -} - -bool Hook::tagsMatch(Scenario *scenario) { - return !scenario || tagExpression->matches(scenario->getTags()); -} - -void AroundStepHook::invokeHook(Scenario *scenario, CallableStep *step) { - this->step = step; - Hook::invokeHook(scenario); -} - -void AroundStepHook::skipHook() { - step->call(); -} - -void UnconditionalHook::invokeHook(Scenario*) { - body(); -} - -HookRegistrar::~HookRegistrar() { -} - -void HookRegistrar::addBeforeHook(BeforeHook *beforeHook) { - beforeHooks().push_back(beforeHook); -} - -HookRegistrar::hook_list_type& HookRegistrar::beforeHooks() { - static hook_list_type *beforeHooks = new hook_list_type(); - return *beforeHooks; -} - -void HookRegistrar::execBeforeHooks(Scenario *scenario) { - execHooks(beforeHooks(), scenario); -} - - -void HookRegistrar::addAroundStepHook(AroundStepHook *aroundStepHook) { - aroundStepHooks().push_front(aroundStepHook); -} - -HookRegistrar::aroundhook_list_type& HookRegistrar::aroundStepHooks() { - static aroundhook_list_type *aroundStepHooks = new aroundhook_list_type(); - return *aroundStepHooks; -} - -InvokeResult HookRegistrar::execStepChain(Scenario *scenario, StepInfo *stepInfo, const InvokeArgs *pArgs) { - StepCallChain scc(scenario, stepInfo, pArgs, aroundStepHooks()); - return scc.exec(); -} - - -void HookRegistrar::addAfterStepHook(AfterStepHook *afterStepHook) { - afterStepHooks().push_front(afterStepHook); -} - -HookRegistrar::hook_list_type& HookRegistrar::afterStepHooks() { - static hook_list_type *afterStepHooks = new hook_list_type(); - return *afterStepHooks; -} - -void HookRegistrar::execAfterStepHooks(Scenario *scenario) { - execHooks(afterStepHooks(), scenario); -} - - -void HookRegistrar::addAfterHook(AfterHook *afterHook) { - afterHooks().push_front(afterHook); -} - -HookRegistrar::hook_list_type& HookRegistrar::afterHooks() { - static hook_list_type *afterHooks = new hook_list_type(); - return *afterHooks; -} - -void HookRegistrar::execAfterHooks(Scenario *scenario) { - execHooks(afterHooks(), scenario); -} - - -void HookRegistrar::execHooks(HookRegistrar::hook_list_type &hookList, Scenario *scenario) { - for (HookRegistrar::hook_list_type::iterator hook = hookList.begin(); hook != hookList.end(); ++hook) { - (*hook)->invokeHook(scenario); - } -} - -HookRegistrar::hook_list_type& HookRegistrar::beforeAllHooks() { - static hook_list_type *beforeAllHooks = new hook_list_type(); - return *beforeAllHooks; -} - -void HookRegistrar::addBeforeAllHook(BeforeAllHook *beforeAllHook) { - beforeAllHooks().push_back(beforeAllHook); -} - -void HookRegistrar::execBeforeAllHooks() { - execHooks(beforeAllHooks(), NULL); -} - -HookRegistrar::hook_list_type& HookRegistrar::afterAllHooks() { - static hook_list_type *afterAllHooks = new hook_list_type(); - return *afterAllHooks; -} - -void HookRegistrar::addAfterAllHook(AfterAllHook *afterAllHook) { - afterAllHooks().push_back(afterAllHook); -} - -void HookRegistrar::execAfterAllHooks() { - execHooks(afterAllHooks(), NULL); -} - - -StepCallChain::StepCallChain( - Scenario *scenario, - StepInfo *stepInfo, - const InvokeArgs *pStepArgs, - HookRegistrar::aroundhook_list_type &aroundHooks -) : - scenario(scenario), - stepInfo(stepInfo), - pStepArgs(pStepArgs) -{ - nextHook = aroundHooks.begin(); - hookEnd = aroundHooks.end(); -} - -InvokeResult StepCallChain::exec() { - execNext(); - return result; -} - -void StepCallChain::execNext() { - if (nextHook == hookEnd) { - execStep(); - } else { - HookRegistrar::aroundhook_list_type::iterator currentHook = nextHook++; - CallableStepChain callableStepChain(this); - (*currentHook)->invokeHook(scenario, &callableStepChain); - } -} - -void StepCallChain::execStep() { - if (stepInfo) { - result = stepInfo->invokeStep(pStepArgs); - } -} - - -CallableStepChain::CallableStepChain(StepCallChain *scc) : scc(scc) {}; - -void CallableStepChain::call() { - scc->execNext(); -} - - -} -} diff --git a/3rdparty/cucumber-cpp/src/Regex.cpp b/3rdparty/cucumber-cpp/src/Regex.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/Regex.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include - -namespace cucumber { -namespace internal { - -Regex::Regex(std::string regularExpression) : - regexImpl(regularExpression.c_str()) { -} - -bool RegexMatch::matches() { - return regexMatched; -} - -const RegexMatch::submatches_type & RegexMatch::getSubmatches() { - return submatches; -} - -std::string Regex::str() const { - return regexImpl.str(); -} - -RegexMatch *Regex::find(const std::string &expression) { - return new FindRegexMatch(regexImpl, expression); -} - -FindRegexMatch::FindRegexMatch(const boost::regex ®exImpl, const std::string &expression) { - boost::cmatch matchResults; - regexMatched = boost::regex_search(expression.c_str(), matchResults, regexImpl, boost::regex_constants::match_extra); - if (regexMatched) { - for (boost::cmatch::size_type i = 1; i < matchResults.size(); ++i) { - RegexSubmatch s; - s.value = matchResults.str(i); - s.position = matchResults.position(i); - submatches.push_back(s); - } - } -} - -RegexMatch *Regex::findAll(const std::string &expression) { - return new FindAllRegexMatch(regexImpl, expression); -} - -FindAllRegexMatch::FindAllRegexMatch(const boost::regex ®exImpl, const std::string &expression) { - regexMatched = false; - boost::sregex_token_iterator i(expression.begin(), expression.end(), regexImpl, 1, boost::regex_constants::match_continuous); - boost::sregex_token_iterator j; - while (i != j) { - regexMatched = true; - RegexSubmatch s; - s.value = *i; - s.position = -1; - submatches.push_back(s); - ++i; - } -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/Scenario.cpp b/3rdparty/cucumber-cpp/src/Scenario.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/Scenario.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include - -namespace cucumber { -namespace internal { - -Scenario::Scenario(const TagExpression::tag_list *pTags) : - pTags(pTags) { - if (!pTags) { - this->pTags = shared_ptr(new TagExpression::tag_list); - } -}; - -const TagExpression::tag_list & Scenario::getTags() { - return *(pTags.get()); -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/StepManager.cpp b/3rdparty/cucumber-cpp/src/StepManager.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/StepManager.cpp +++ /dev/null @@ -1,196 +0,0 @@ -#include "cucumber-cpp/internal/step/StepManager.hpp" - -namespace cucumber { -namespace internal { - - -StepInfo::StepInfo(const std::string &stepMatcher, const std::string source) : - regex(stepMatcher), - source(source) { - static step_id_type currentId = 0; - id = ++currentId; -} - -SingleStepMatch StepInfo::matches(const std::string &stepDescription) { - SingleStepMatch stepMatch; - shared_ptr regexMatch(regex.find(stepDescription)); - if (regexMatch->matches()) { - stepMatch.stepInfo = this; - stepMatch.submatches = regexMatch->getSubmatches(); - } - return stepMatch; -} - -SingleStepMatch::SingleStepMatch() : - stepInfo(0) { -} - -SingleStepMatch::SingleStepMatch(const SingleStepMatch &match) : - stepInfo(match.stepInfo), - submatches(match.submatches) { -} - -SingleStepMatch & SingleStepMatch::operator =(const SingleStepMatch &match) { - stepInfo = match.stepInfo; - submatches = match.submatches; - return *this; -} - -SingleStepMatch::operator void *() { - return (void *) stepInfo; -} - -MatchResult::operator void *() { - return (void *) resultSet.size(); -} - -MatchResult::operator bool() { - return !resultSet.empty(); -} - -const MatchResult::match_results_type& MatchResult::getResultSet() { - return resultSet; -} - -void MatchResult::addMatch(SingleStepMatch match) { - resultSet.push_back(match); -} - - -void InvokeArgs::addArg(const std::string arg) { - args.push_back(arg); -} - -const Table & InvokeArgs::getTableArg() const { - return tableArg; -} - -Table & InvokeArgs::getVariableTableArg() { - return tableArg; -} - - -InvokeResult::InvokeResult(const InvokeResultType type, const char *description) : - type(type) { - if (description) { this->description = description; }; -} - -InvokeResult::InvokeResult() : - type(FAILURE) { -} - -InvokeResult::InvokeResult(const InvokeResult &ir) : - type(ir.type), - description(ir.description) { -} - -InvokeResult& InvokeResult::operator= (const InvokeResult &rhs) { - this->type = rhs.type; - this->description = rhs.description; - return *this; -} - -InvokeResult InvokeResult::success() { - return InvokeResult(SUCCESS, 0); -} - -InvokeResult InvokeResult::failure(const char *description) { - return InvokeResult(FAILURE, description); -} - -InvokeResult InvokeResult::failure(const std::string &description) { - return InvokeResult(FAILURE, description.c_str()); -} - -InvokeResult InvokeResult::pending(const char *description) { - return InvokeResult(PENDING, description); -} - -bool InvokeResult::isSuccess() const { - return (type == SUCCESS); -} - -bool InvokeResult::isPending() const { - return (type == PENDING); -} - -const InvokeResultType InvokeResult::getType() const { - return type; -} - -const std::string &InvokeResult::getDescription() const { - return description; -} - - -StepManager::~StepManager() { -} - -void StepManager::addStep(StepInfo *stepInfo) { - steps().insert(std::make_pair(stepInfo->id, stepInfo)); -} - -MatchResult StepManager::stepMatches(const std::string &stepDescription) const { - MatchResult matchResult; - for (steps_type::iterator iter = steps().begin(); iter != steps().end(); ++iter) { - StepInfo *stepInfo = iter->second; - SingleStepMatch currentMatch = stepInfo->matches(stepDescription); - if (currentMatch) { - matchResult.addMatch(currentMatch); - } - } - return matchResult; -} - -StepInfo *StepManager::getStep(step_id_type id) { - return steps()[id]; -} - -/** - * Needed to fix the "static initialization order fiasco" - * http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12 - */ -StepManager::steps_type& StepManager::steps() const { - static steps_type *steps = new steps_type(); - return *steps; -} - - -InvokeResult BasicStep::invoke(const InvokeArgs *pArgs) { - this->pArgs = pArgs; - currentArgIndex = 0; - currentResult = InvokeResult::success(); - try { - InvokeResult returnedResult = invokeStepBody(); - if (currentResult.isPending()) { - return currentResult; - } else { - return returnedResult; - } - } catch (const std::exception& ex) { - return InvokeResult::failure(ex.what()); - } catch (const std::string& ex) { - return InvokeResult::failure(ex); - } catch (const char *ex) { - return InvokeResult::failure(ex); - } catch (...) { - // Cucumber needs a description here - return InvokeResult::failure("Unknown exception"); - } -} - -void BasicStep::pending() { - pending(0); -} - -void BasicStep::pending(const char *description) { - currentResult = InvokeResult::pending(description); -} - -const InvokeArgs *BasicStep::getArgs() { - return pArgs; -} - -} -} - diff --git a/3rdparty/cucumber-cpp/src/Table.cpp b/3rdparty/cucumber-cpp/src/Table.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/Table.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include - -namespace cucumber { -namespace internal { - -void Table::addColumn(const std::string column) { - if (rows.empty()) { - columns.push_back(column); - } else { - throw std::runtime_error("Cannot alter columns after rows have been added"); - } -} - -void Table::addRow(const row_type &row) { - const basic_type::size_type colSize = columns.size(); - if (colSize == 0) { - throw std::runtime_error("No column defined yet"); - } else if (colSize != row.size()) { - throw std::range_error("Row size does not match the table column size"); - } else { - rows.push_back(buildHashRow(row)); - } -} - -Table::hash_row_type Table::buildHashRow(const row_type &row) { - hash_row_type hashRow; - for (columns_type::size_type i = 0; i < columns.size(); ++i) { - hashRow[columns[i]] = row[i]; - } - return hashRow; -} - -const Table::hashes_type & Table::hashes() const { - return rows; -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/Tag.cpp b/3rdparty/cucumber-cpp/src/Tag.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/Tag.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include - -namespace cucumber { -namespace internal { - -Regex & AndTagExpression::csvTagNotationRegex() { - static Regex r("\\s*\"([^\"]+)\"\\s*(?:,|$)"); - return r; -} - -AndTagExpression::AndTagExpression(const std::string &csvTagNotation) { - const shared_ptr match(csvTagNotationRegex().findAll(csvTagNotation)); - const RegexMatch::submatches_type submatches = match->getSubmatches(); - for (RegexMatch::submatches_type::const_iterator i = submatches.begin(); i != submatches.end(); ++i) { - const std::string orCsvTagNotation = i->value; - shared_ptr orExpression(new OrTagExpression(orCsvTagNotation)); - orExpressions.push_back(orExpression); - } -} - -bool AndTagExpression::matches(const tag_list &tags) { - bool match = true; - for (or_expressions_type::const_iterator i = orExpressions.begin(); i != orExpressions.end() && match; ++i) { - match &= (*i)->matches(tags); - } - return match; -} - - -Regex & OrTagExpression::csvTagNotationRegex() { - static Regex r("\\s*@(\\w+)\\s*(?:,|$)"); - return r; -} - -OrTagExpression::OrTagExpression(const std::string &csvTagNotation) { - const shared_ptr match(csvTagNotationRegex().findAll(csvTagNotation)); - const RegexMatch::submatches_type submatches = match->getSubmatches(); - for (RegexMatch::submatches_type::const_iterator i = submatches.begin(); i != submatches.end(); ++i) { - orTags.push_back(i->value); - } -} - -bool OrTagExpression::matches(const tag_list &tags) { - bool match = false; - for (tag_list::const_iterator i = orTags.begin(); i != orTags.end() && !match; ++i) { - match = orTagMatchesTagList(*i, tags); - } - return match; -} - -bool OrTagExpression::orTagMatchesTagList(const std::string ¤tOrTag, const tag_list &tags) { - bool match = false; - for (tag_list::const_iterator i = tags.begin(); i != tags.end() && !match; ++i) { - match = ((*i) == currentOrTag); - } - return match; -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/connectors/wire/WireProtocol.cpp b/3rdparty/cucumber-cpp/src/connectors/wire/WireProtocol.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/connectors/wire/WireProtocol.cpp +++ /dev/null @@ -1,346 +0,0 @@ -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include - -using namespace json_spirit; - -namespace cucumber { -namespace internal { - - -/* - * Responses - */ - - -void SuccessResponse::accept(WireResponseVisitor *visitor) const { - visitor->visit(this); -} - -FailureResponse::FailureResponse(const std::string & message, const std::string & exceptionType) : - message(message), - exceptionType(exceptionType) { -} - -const std::string FailureResponse::getMessage() const { - return message; -} - -const std::string FailureResponse::getExceptionType() const { - return exceptionType; -} - -void FailureResponse::accept(WireResponseVisitor *visitor) const { - visitor->visit(this); -} - -PendingResponse::PendingResponse(const std::string & message) : - message(message) { -} - -const std::string PendingResponse::getMessage() const { - return message; -} - -void PendingResponse::accept(WireResponseVisitor *visitor) const { - visitor->visit(this); -} - -StepMatchesResponse::StepMatchesResponse(const std::vector & matchingSteps) - : matchingSteps(matchingSteps) { -} - -const std::vector& StepMatchesResponse::getMatchingSteps() const { - return matchingSteps; -} - -void StepMatchesResponse::accept(WireResponseVisitor *visitor) const { - visitor->visit(this); -} - -SnippetTextResponse::SnippetTextResponse(const std::string & stepSnippet) : - stepSnippet(stepSnippet) { -} - -const std::string SnippetTextResponse::getStepSnippet() const { - return stepSnippet; -} - -void SnippetTextResponse::accept(WireResponseVisitor *visitor) const { - visitor->visit(this); -} - - -/* - * Command decoders - */ - - -class CommandDecoder { -public: - virtual WireCommand *decode(const mValue & jsonArgs) const = 0; -}; - - -class ScenarioDecoder : public CommandDecoder { -protected: - CukeEngine::tags_type *getTags(const mValue & jsonArgs) const { - CukeEngine::tags_type *tags = new CukeEngine::tags_type; - if (!jsonArgs.is_null()) { - const mArray & jsonTags = jsonArgs.get_obj().find("tags")->second.get_array(); - for (mArray::const_iterator i = jsonTags.begin(); i != jsonTags.end(); ++i) { - tags->push_back(i->get_str()); - } - } - return tags; - } -}; - - -class BeginScenarioDecoder : public ScenarioDecoder { -public: - WireCommand *decode(const mValue & jsonArgs) const { - return new BeginScenarioCommand(getTags(jsonArgs)); - } -}; - - -class EndScenarioDecoder : public ScenarioDecoder { -public: - WireCommand *decode(const mValue & jsonArgs) const { - return new EndScenarioCommand(getTags(jsonArgs)); - } -}; - - -class StepMatchesDecoder : public CommandDecoder { -public: - WireCommand *decode(const mValue & jsonArgs) const { - mObject stepMatchesArgs(jsonArgs.get_obj()); - const std::string & nameToMatch(stepMatchesArgs["name_to_match"].get_str()); - return new StepMatchesCommand(nameToMatch); - } -}; - - -class InvokeDecoder : public CommandDecoder { -public: - WireCommand *decode(const mValue & jsonArgs) const { - mObject invokeParams(jsonArgs.get_obj()); - - CukeEngine::invoke_args_type *args = new CukeEngine::invoke_args_type; - CukeEngine::invoke_table_type *tableArg = new CukeEngine::invoke_table_type; - const std::string & id(invokeParams["id"].get_str()); - fillInvokeArgs(invokeParams, *args, *tableArg); - return new InvokeCommand(id, args, tableArg); - } - -private: - void fillInvokeArgs( - const mObject & invokeParams, - CukeEngine::invoke_args_type & args, - CukeEngine::invoke_table_type & tableArg) const { - const mArray & jsonArgs(invokeParams.find("args")->second.get_array()); - for (mArray::const_iterator i = jsonArgs.begin(); i != jsonArgs.end(); ++i) { - if (i->type() == str_type) { - args.push_back(i->get_str()); - } else if (i->type() == array_type) { - fillTableArg(i->get_array(), tableArg); - } - } - } - - void fillTableArg(const mArray & jsonTableArg, CukeEngine::invoke_table_type & tableArg) const { - typedef mArray::size_type size_type; - size_type rows = jsonTableArg.size(); - if (rows > 0) { - size_type columns = jsonTableArg[0].get_array().size(); - tableArg.resize(boost::extents[rows][columns]); - for (size_type i = 0; i < rows; ++i) { - const mArray & jsonRow(jsonTableArg[i].get_array()); - if (jsonRow.size() == columns) { - for (size_type j = 0; j < columns; ++j) { - tableArg[i][j] = jsonRow[j].get_str(); - } - } else { - // TODO: Invalid row - } - } - } else { - // TODO: Invalid table (no column specified) - } - } -}; - - -class SnippetTextDecoder : public CommandDecoder { -public: - WireCommand *decode(const mValue & jsonArgs) const { - mObject snippetTextArgs(jsonArgs.get_obj()); - const std::string & stepKeyword(snippetTextArgs["step_keyword"].get_str()); - const std::string & stepName(snippetTextArgs["step_name"].get_str()); - const std::string & multilineArgClass(snippetTextArgs["multiline_arg_class"].get_str()); - return new SnippetTextCommand(stepKeyword, stepName, multilineArgClass); - } -}; - -static std::map > commandDecodersMap = boost::assign::map_list_of - ("begin_scenario", boost::shared_ptr (new BeginScenarioDecoder)) - ("end_scenario", boost::shared_ptr (new EndScenarioDecoder)) - ("step_matches", boost::shared_ptr (new StepMatchesDecoder)) - ("invoke", boost::shared_ptr (new InvokeDecoder)) - ("snippet_text", boost::shared_ptr (new SnippetTextDecoder)); - - -JsonSpiritWireMessageCodec::JsonSpiritWireMessageCodec() {}; - -WireCommand *JsonSpiritWireMessageCodec::decode(const std::string &request) const { - std::istringstream is(request); - mValue json; - try { - read_stream(is, json); - mArray & jsonRequest = json.get_array(); - mValue & jsonCommand = jsonRequest[0]; - - CommandDecoder *commandDecoder = commandDecodersMap[jsonCommand.get_str()].get(); - if (commandDecoder != NULL) { - mValue jsonArgs; - if (jsonRequest.size() > 1) { - jsonArgs = jsonRequest[1]; - } - return commandDecoder->decode(jsonArgs); - } - } catch (...) { - // LOG Error decoding wire protocol command - } - return new FailingCommand; -} - -namespace { - - class WireResponseEncoder : public WireResponseVisitor { - private: - mArray jsonOutput; - - void success(const mValue *detail = 0) { - output("success", detail); - } - - void fail(const mValue *detail = 0) { - output("fail", detail); - } - - void output(const char *responseType, const mValue *detail = 0) { - jsonOutput.push_back(responseType); - if (detail == 0 || detail->is_null()) { - return; - } - jsonOutput.push_back(*detail); - } - - public: - std::string encode(const WireResponse *response) { - jsonOutput.clear(); - response->accept(this); - const mValue v(jsonOutput); - return write_string(v, false); - } - - void visit(const SuccessResponse *response) { - success(); - } - - void visit(const FailureResponse *response) { - mObject detailObject; - if (!response->getMessage().empty()) { - detailObject["message"] = response->getMessage(); - } - if (!response->getExceptionType().empty()) { - detailObject["exception"] = response->getExceptionType(); - } - if (detailObject.empty()) { - fail(); - } else { - const mValue detail(detailObject); - fail(&detail); - } - } - - void visit(const PendingResponse *response) { - mValue jsonReponse(response->getMessage()); - output("pending", &jsonReponse); - } - - void visit(const StepMatchesResponse *response) { - mArray jsonMatches; - BOOST_FOREACH(StepMatch m, response->getMatchingSteps()) { - mObject jsonM; - jsonM["id"] = m.id; - mArray jsonArgs; - BOOST_FOREACH(StepMatchArg ma, m.args) { - mObject jsonMa; - jsonMa["val"] = ma.value; - jsonMa["pos"] = ma.position; - jsonArgs.push_back(jsonMa); - } - jsonM["args"] = jsonArgs; - if (!m.source.empty()) { - jsonM["source"] = m.source;; - } - if (!m.regexp.empty()) { - jsonM["regexp"] = m.regexp; - } - jsonMatches.push_back(jsonM); - } - mValue jsonReponse(jsonMatches); - output("success", &jsonReponse); - } - - void visit(const SnippetTextResponse *response) { - mValue jsonReponse(response->getStepSnippet()); - success(&jsonReponse); - } - }; - -} - -const std::string JsonSpiritWireMessageCodec::encode(const WireResponse *response) const { - try { - WireResponseEncoder encoder; - return encoder.encode(response); - } catch (...) { - throw WireMessageCodecException("Error decoding wire protocol response"); - } -} - -WireProtocolHandler::WireProtocolHandler(const WireMessageCodec *codec, CukeEngine *engine) : - codec(codec), - engine(engine) { -} - -std::string WireProtocolHandler::handle(const std::string &request) const { - std::string response; - // LOG request - try { - const WireCommand *command = codec->decode(request); - const WireResponse *wireResponse = command->run(engine); - response = codec->encode(wireResponse); - } catch (...) { - response = "[\"fail\"]"; - } - // LOG response - return response; -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/connectors/wire/WireProtocolCommands.cpp b/3rdparty/cucumber-cpp/src/connectors/wire/WireProtocolCommands.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/connectors/wire/WireProtocolCommands.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include - -namespace cucumber { -namespace internal { - -ScenarioCommand::ScenarioCommand(const CukeEngine::tags_type *tags) : - tags(tags) { -} - - -BeginScenarioCommand::BeginScenarioCommand(const CukeEngine::tags_type *tags) : - ScenarioCommand(tags) { -} - -WireResponse *BeginScenarioCommand::run(CukeEngine *engine) const { - engine->beginScenario(*tags); - return new SuccessResponse; -} - - -EndScenarioCommand::EndScenarioCommand(const CukeEngine::tags_type *tags) : - ScenarioCommand(tags) { -} - -WireResponse *EndScenarioCommand::run(CukeEngine *engine) const { - engine->endScenario(*tags); - return new SuccessResponse; -} - - -StepMatchesCommand::StepMatchesCommand(const std::string & stepName) : - stepName(stepName) { -} - -WireResponse *StepMatchesCommand::run(CukeEngine *engine) const { - std::vector matchingSteps = engine->stepMatches(stepName); - return new StepMatchesResponse(matchingSteps); -} - - -InvokeCommand::InvokeCommand(const std::string & stepId, - const CukeEngine::invoke_args_type *args, - const CukeEngine::invoke_table_type * tableArg) : - stepId(stepId), - args(args), - tableArg(tableArg) { -} - -WireResponse *InvokeCommand::run(CukeEngine *engine) const { - try { - engine->invokeStep(stepId, *args, *tableArg); - return new SuccessResponse; - } catch (const InvokeFailureException &e) { - return new FailureResponse(e.getMessage(), e.getExceptionType()); - } catch (const PendingStepException &e) { - return new PendingResponse(e.getMessage()); - } catch (...) { - return new FailureResponse; - } -} - - -SnippetTextCommand::SnippetTextCommand(const std::string & keyword, const std::string & name, const std::string & multilineArgClass) : - keyword(keyword), - name(name), - multilineArgClass(multilineArgClass) { -} - -WireResponse *SnippetTextCommand::run(CukeEngine *engine) const { - return new SnippetTextResponse(engine->snippetText(keyword, name, multilineArgClass)); -} - - -WireResponse *FailingCommand::run(CukeEngine *engine) const { - return new FailureResponse; -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/connectors/wire/WireServer.cpp b/3rdparty/cucumber-cpp/src/connectors/wire/WireServer.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/connectors/wire/WireServer.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include - -namespace cucumber { -namespace internal { - -SocketServer::SocketServer(const ProtocolHandler *protocolHandler) : - ios(), - acceptor(ios), - protocolHandler(protocolHandler) { -} - -void SocketServer::listen(const port_type port) { - tcp::endpoint endpoint(tcp::v4(), port); - acceptor.open(endpoint.protocol()); - acceptor.set_option(tcp::acceptor::reuse_address(true)); - acceptor.bind(endpoint); - acceptor.listen(1); -} - -void SocketServer::acceptOnce() { - tcp::iostream stream; - acceptor.accept(*stream.rdbuf()); - processStream(stream); -} - -void SocketServer::processStream(tcp::iostream &stream) { - std::string request; - while (getline(stream, request)) { - stream << protocolHandler->handle(request) << std::endl << std::flush; - } -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/drivers/BoostDriver.cpp b/3rdparty/cucumber-cpp/src/drivers/BoostDriver.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/drivers/BoostDriver.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include - -#include - -#include -#include - -#include -#include - -using namespace ::boost::unit_test; -using ::boost::execution_exception; - -namespace cucumber { -namespace internal { - - -namespace { - -bool boost_test_init() { - return true; -} - -static CukeBoostLogInterceptor *logInterceptor = 0; - -} - - -class CukeBoostLogInterceptor : public ::boost::unit_test::unit_test_log_formatter { -public: - const InvokeResult getResult() const; - void reset(); - - // Formatter - void log_start( std::ostream&, counter_t test_cases_amount) {}; - void log_finish( std::ostream&) {}; - void log_build_info( std::ostream&) {}; - - void test_unit_start( std::ostream&, test_unit const& tu) {}; - void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed) {}; - void test_unit_skipped( std::ostream&, test_unit const& tu) {}; - - void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let) {}; - void log_entry_value( std::ostream&, const_string value); - void log_entry_value( std::ostream&, lazy_ostream const& value) {}; - void log_entry_finish( std::ostream&) {}; - -#if BOOST_VERSION < 105900 - void log_exception(std::ostream&, log_checkpoint_data const&, execution_exception const& ex) {}; - void log_exception(std::ostream&, const boost::unit_test::log_checkpoint_data&, boost::unit_test::const_string) {}; -#elif BOOST_VERSION < 106500 - void entry_context_start(std::ostream&, log_level) {}; - void log_entry_context(std::ostream&, const_string value ) {}; - void entry_context_finish(std::ostream&) {}; - - void log_exception_start(std::ostream&, const log_checkpoint_data&, const boost::execution_exception&) {}; - void log_exception_finish(std::ostream&) {}; -#else - void entry_context_start(std::ostream&, log_level) {}; - void log_entry_context(std::ostream&, log_level, const_string value ) {}; - void entry_context_finish(std::ostream&, log_level) {}; - - void log_exception_start(std::ostream&, const log_checkpoint_data&, const boost::execution_exception&) {}; - void log_exception_finish(std::ostream&) {}; -#endif - -private: - std::stringstream description; -}; - -void CukeBoostLogInterceptor::reset() { - description.str(""); -} - -/* - * Threshold level set to log_all_errors, so we should be fine logging everything - */ -void CukeBoostLogInterceptor::log_entry_value( std::ostream&, const_string value) { - description << value; -}; - -const InvokeResult CukeBoostLogInterceptor::getResult() const { - std::string d = description.str(); - if (d.empty()) { - return InvokeResult::success(); - } else { - return InvokeResult::failure(description.str()); - } -} - -const InvokeResult BoostStep::invokeStepBody() { - initBoostTest(); - logInterceptor->reset(); - runWithMasterSuite(); - return logInterceptor->getResult(); -} - -void BoostStep::initBoostTest() { -#if BOOST_VERSION < 105900 - if (!framework::is_initialized()) { -#else - if (!framework::test_in_progress()) { -#endif -#if BOOST_VERSION < 106000 - int argc = 2; - char *argv[] = { (char *) "", (char *) "" }; -#else - int argc = 1; - char *argv[] = { (char *) "cucumber-cpp" }; -#endif - framework::init(&boost_test_init, argc, argv); - logInterceptor = new CukeBoostLogInterceptor; - ::boost::unit_test::unit_test_log.set_formatter(logInterceptor); - ::boost::unit_test::unit_test_log.set_threshold_level(log_all_errors); - } -} - -void BoostStep::runWithMasterSuite() { - using namespace ::boost::unit_test; - test_case *tc = BOOST_TEST_CASE(boost::bind(&BoostStep::body, this)); - framework::master_test_suite().add(tc); -#if BOOST_VERSION >= 105900 - framework::finalize_setup_phase(); -#endif - framework::run(tc, false); - framework::master_test_suite().remove(tc->p_id); -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/drivers/CppSpecDriver.cpp b/3rdparty/cucumber-cpp/src/drivers/CppSpecDriver.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/drivers/CppSpecDriver.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include - -#include - -namespace cucumber { -namespace internal { - -const InvokeResult CppSpecStep::invokeStepBody() { - try { - body(); - return InvokeResult::success(); - } catch (const ::CppSpec::SpecifyFailedException &e) { - return InvokeResult::failure(e.message); - } -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/drivers/GTestDriver.cpp b/3rdparty/cucumber-cpp/src/drivers/GTestDriver.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/drivers/GTestDriver.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include - -#include - -namespace cucumber { -namespace internal { - -bool GTestStep::initialized(false); - -const InvokeResult GTestStep::invokeStepBody() { - if (!initialized) { - initGTest(); - initFlags(); - } - try { - body(); - return InvokeResult::success(); - } catch (const ::std::runtime_error &e) { - // ::testing::GoogleTestFailureException inherits from ::std::runtime_error - return InvokeResult::failure(e.what()); - } -} - -void GTestStep::initGTest() { - int fake_argc = 1; - char *fake_argv[1]; - fake_argv[0] = (char *) "cucumber-cpp"; - ::testing::InitGoogleTest(&fake_argc, fake_argv); - initialized = true; -} - -void GTestStep::initFlags() { - ::testing::GTEST_FLAG(throw_on_failure) = true; // let cucumber-cpp drive - ::testing::GTEST_FLAG(break_on_failure) = false; // turn off debugger breakpoints - ::testing::GTEST_FLAG(catch_exceptions) = true; -} - -} -} diff --git a/3rdparty/cucumber-cpp/src/main.cpp b/3rdparty/cucumber-cpp/src/main.cpp deleted file mode 100644 --- a/3rdparty/cucumber-cpp/src/main.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include -#include -#include - -namespace { - -void acceptWireProtocol(int port) { - using namespace ::cucumber::internal; - CukeEngineImpl cukeEngine; - JsonSpiritWireMessageCodec wireCodec; - WireProtocolHandler protocolHandler(&wireCodec, &cukeEngine); - SocketServer server(&protocolHandler); - server.listen(port); - while (true) - server.acceptOnce(); -} - -} - -int main(int argc, char **argv) { - try { - int port = 3902; - if (argc > 1) { - std::string firstArg(argv[1]); - port = ::cucumber::internal::fromString(firstArg); - } - acceptWireProtocol(port); - } catch (std::exception &e) { - std::cerr << e.what() << std::endl; - exit(1); - } - return 0; -} diff --git a/3rdparty/cucumber-cpp/tests/CMakeLists.txt b/3rdparty/cucumber-cpp/tests/CMakeLists.txt deleted file mode 100644