conan-io / wishlist

This repo is to propose libraries, frameworks, and code in general that users would like to have in conan
MIT License
49 stars 5 forks source link

Cucumber-cpp: Support for writing Cucumber step definitions in C++ #130

Closed helmesjo closed 6 years ago

helmesjo commented 6 years ago

Cucumber is a tool that supports Behaviour-Driven Development (BDD).

Cucumber-cpp implements the cucumber wire protocol and enables writing step-definitions in C++.

Building

Building Cucumber-Cpp with tests and samples:

# Download test suite
git submodule init
git submodule update

# Create build directory
cmake -E make_directory build

# Generate Makefiles
cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on ..

# Build cucumber-cpp and tests
cmake --build build

# Run unit tests
cmake --build build --target test

# Check implementation against common cucumber test suite
cmake --build build --target features

Dependencies

It relies on a few libraries:

Boost 1.46 or later (1.51+ on Windows). Required libraries: thread, system, regex, date_time and program_options. Optional library for Boost Test driver: test. GTest 1.6 or later. Optional for the GTest driver. By default downloaded and built by CMake. GMock 1.6 or later. Optional for the internal test suite. By default downloaded and built by CMake. Qt 4 or 5. Optional for the CalcQt example and QtTest driver (only Qt 5).

In practice, using bincrafters modular boost packages, the following is what works for me (I'm using the GTest driver, but as mentioned above Boost_test is an alternative):

# conanfile.txt
[requires]
# boost
cmake_findboost_modular/1.65.1@bincrafters/stable
boost_asio/1.65.1@bincrafters/stable
boost_assign/1.65.1@bincrafters/stable
boost_date_time/1.65.1@bincrafters/stable
boost_filesystem/1.65.1@bincrafters/stable
boost_multi_array/1.65.1@bincrafters/stable
boost_regex/1.65.1@bincrafters/stable
boost_program_options/1.65.1@bincrafters/stable
boost_system/1.65.1@bincrafters/stable
boost_thread/1.65.1@bincrafters/stable
# other
gtest/1.8.0@bincrafters/stable
#boost_test/1.65.1@bincrafters/stable

So a possible option would be something like cucumber-cpp:test_driver=<gtest/boost>.

It currently fails to build with boost 1.66.0.

helmesjo commented 6 years ago

I've started working on a recipe that can be found here: helmesjo/conan-cucumber-cpp

It is based on the bincrafters conan-template and currently builds for linux (gcc, clang not tested). On windows there are some minor issues with FindBoost currently, but should otherwise work there as well. ~Also waiting for the v0.5 release so that boost 1.66.0 gets supported.~

Build Status Build status

helmesjo commented 6 years ago

Builds on GCC, Clang, Apple-Clang & Visual Studio (see here for all versions).

At the time of writing there is a missing pre-built boost package for GCC 6.0, otherwise all remaining jobs pass.

Considering this one done!