Discussion:
[Cucumber] [CPP] how to proceed after having built Cucumber-Cpp sources?
(too old to reply)
'Sanda Aitonean' via Cukes
2014-09-23 18:02:36 UTC
Permalink
Hello,

I am new to the BDD world, want to try-out Cucumber-cpp in an Windows 7
environment, but don’t know how to proceed after having built its sources
(how to get to the server needed to be launched in order to run the example
features)
I followed instructions from
http://infowarestudios.co.za/agile-testing-getting-agile-tests-incorporated-into-your-sprints-using-bdd-and-cucumber-in-c/,
but not all worked exactly as described there.

I understand that: in order to use Cucumber-cpp, first I need to
install/build its prerequisites, then build the Cucumber-Cpp sources to a
library, and ultimately create my step definition files (C++) and build
them against the Cucumber-cpp library. In order to run my feature files, I
should be starting a server (is this an executable resulting from the build
of Cucumber-cpp sources, or is it something I should be creating myself?)
that ‘talks’ to the ruby implementation of Cucumber, allowing it to
interpret C++ written steps. (Hope there is some true in the above.)

Here’s what I did for the setup so far:


1. Install *Ruby on Windows* and the *Cucumber gem*:

- rubyinstaller-1.9.3-p545.exe from http://rubyinstaller.org/
- cucumber gem 1.3.16 and its dependencies –had to install them
manually (‘gem install cucumber’ command fails – proxy/firewall prevents
downloads) from *http <http://rubygems.org/gems/cucumber>://
<http://rubygems.org/gems/cucumber>rubygems.org/gems/cucumber
<http://rubygems.org/gems/cucumber>*. Note: installation of the gherkin gem
(dependency) required to install DevKit:
DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe, *https://
<https://github.com/oneclick/rubyinstaller/wiki/Development-Kit>github.com/oneclick/rubyinstaller/wiki/Development-Kit
<https://github.com/oneclick/rubyinstaller/wiki/Development-Kit>*

1. Get *Cucumber-cpp sources* to c:\Cucumber\cucumber-cpp, from
https://github.com/cucumber/cucumber-cppn(cucumber-cpp-master.zip,
latest commit 515e398047)
2. Build* Boost *sources, version 1.55.0, from http://www.boost.org/

*c:\Boost\boost_1_55_0>bootstrap.bat*
* c:\Boost\boost_1_55_0>.\b2 --prefix=C:\Boost
--build-type=complete address-model=32 install*

4. Install *Cmake,* cmake-2.8.12.2-win32-x86.exe from *http://www.cmake.org/cmake/resources/software.html
<http://www.cmake.org/cmake/resources/software.html>*
5. Obtain a solution file (.sln) for the *cucumber-Cpp* library
and example

*cd c:\Cucumber\cucumber-cpp cmake -E make_directory vsprj*
* c:\Cucumber\cucumber-cpp>cmake -E chdir vsprj cmake -G
"Visual Studio 11" -DCUKE_ENABLE_EXAMPLES=on -DBOOST_ROOT=c:\Boost . ..*

6. Build Cucumber-cpp.sln with VisualStudio 2012, after solving some
build errors, e.g. 'cannot open include file boost\shared_ptr.hpp' - had to
add to the include folders C:\Boost\include\boost-1_55

In order to run the features in the ‘Calculator’ example, I am supposed to
start a server which I don’t have (there is no BoostCalculatorSteps.exe in
folder vsprj\examples\Calc\Debug).
I read at
https://github.com/cucumber/cucumber-cpp/wiki/Primer#compiling-and-running that
I would need to configure the wire protocol; where would I have to do that
in order to run the Calculator example, and how does that relate to the
BoostCalculatorSteps.exe?

I would appreciate any help, thanks in advance,
Sanda
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Paolo Ambrosio
2014-09-30 10:25:02 UTC
Permalink
Hi Sanda,

Sorry for the late reply but I'm on holiday at the moment.

On Tue, Sep 23, 2014 at 8:02 PM, 'Sanda Aitonean' via Cukes
Post by 'Sanda Aitonean' via Cukes
Hello,
I am new to the BDD world, want to try-out Cucumber-cpp in an Windows 7
environment, but don’t know how to proceed after having built its sources
(how to get to the server needed to be launched in order to run the example
features)
I followed instructions from
http://infowarestudios.co.za/agile-testing-getting-agile-tests-incorporated-into-your-sprints-using-bdd-and-cucumber-in-c/,
but not all worked exactly as described there.
It's a dead link now but haven you tried following the official introduction?

https://github.com/cucumber/cucumber-cpp/wiki/Primer-0.3
Post by 'Sanda Aitonean' via Cukes
I understand that: in order to use Cucumber-cpp, first I need to
install/build its prerequisites, then build the Cucumber-Cpp sources to a
library, and ultimately create my step definition files (C++) and build them
against the Cucumber-cpp library.
That looks correct.
Post by 'Sanda Aitonean' via Cukes
In order to run my feature files, I should
be starting a server (is this an executable resulting from the build of
Cucumber-cpp sources, or is it something I should be creating myself?) that
‘talks’ to the ruby implementation of Cucumber, allowing it to interpret C++
written steps. (Hope there is some true in the above.)
Yes. The cucumber-cpp static library contains also a main method that
runs the wire protocol server. You can link the library to your step
definitions and produce an executable without the need to write a main
method yourself.
Post by 'Sanda Aitonean' via Cukes
- rubyinstaller-1.9.3-p545.exe from http://rubyinstaller.org/
- cucumber gem 1.3.16 and its dependencies –had to install them
manually (‘gem install cucumber’ command fails – proxy/firewall prevents
downloads) from http://rubygems.org/gems/cucumber. Note: installation of the
DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe,
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
Get Cucumber-cpp sources to c:\Cucumber\cucumber-cpp, from
https://github.com/cucumber/cucumber-cppn(cucumber-cpp-master.zip, latest
commit 515e398047)
Build Boost sources, version 1.55.0, from http://www.boost.org/
c:\Boost\boost_1_55_0>bootstrap.bat
c:\Boost\boost_1_55_0>.\b2 --prefix=C:\Boost
--build-type=complete address-model=32 install
4. Install Cmake, cmake-2.8.12.2-win32-x86.exe from
http://www.cmake.org/cmake/resources/software.html
5. Obtain a solution file (.sln) for the cucumber-Cpp library and
example
cd c:\Cucumber\cucumber-cpp
cmake -E make_directory vsprj
c:\Cucumber\cucumber-cpp>cmake -E chdir vsprj cmake -G
"Visual Studio 11" -DCUKE_ENABLE_EXAMPLES=on -DBOOST_ROOT=c:\Boost . ..
6. Build Cucumber-cpp.sln with VisualStudio 2012, after solving some
build errors, e.g. 'cannot open include file boost\shared_ptr.hpp' - had to
add to the include folders C:\Boost\include\boost-1_55
I'd have to check what happens with Vistual Studio, but you shouldn't
have to manually fix the solution. I'm wondering if CMake found the
Boost Test library, as that would remove BoostCalculatorSteps.exe from
the build. Please note that Boost Test must to be available as a
dynamic library.

Have you tried using cmake with the NMake build (not Visual Studio)?
The wiki has more detailed steps on that scenario.
Post by 'Sanda Aitonean' via Cukes
In order to run the features in the ‘Calculator’ example, I am supposed to
start a server which I don’t have (there is no BoostCalculatorSteps.exe in
folder vsprj\examples\Calc\Debug).
I read at
https://github.com/cucumber/cucumber-cpp/wiki/Primer#compiling-and-running
that I would need to configure the wire protocol; where would I have to do
that in order to run the Calculator example, and how does that relate to the
BoostCalculatorSteps.exe?
Linking the step definitions to the cucumber-cpp library will produce
an executable.
Post by 'Sanda Aitonean' via Cukes
I would appreciate any help, thanks in advance,
Sanda
Paolo
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
'Sanda Aitonean' via Cukes
2014-11-19 14:47:10 UTC
Permalink
Hi Paolo,

Thank you for your answer.

In the meantime I managed to find the issue, and that was the build
parameters for Boost.
I'll summarize again the steps I took to get a correct installation of
Cucumber-cpp, hopefully this would help other people running into the same
issue

All the best,
Sanda

Install Ruby on Windows and the Cucumber gem

====================================

Install ruby with install rubyinstaller-1.9.3-p545.exe from
http://rubyinstaller.org/

Remove following env vars: (to be done at every start of cmd, using 'set
HOMEDRIVE=' )

HOMEDRIVE=H:

HOMEPATH=\

HOMESHARE=\\nlybstqvp1ms118\nly96175



Set the following env vars:

HTTP_PROXY=<your_value>

RDOCOPT=--encoding=UTF-8 (see
http://stackoverflow.com/questions/7897101/error-installing-rdoc-documentation-incompatible-encoding-regexp-match
)



Do in a command window:

gem update --system

gem install cucumber



Download, unpack and build boost

================================

2. Download and unpack boost to c:\Boost (for easy reference): version
1.55.0, from http://www.boost.org/



First call:

Bootstrap.bat

Then call:

*.\b2 --prefix=c:\Boost --build-type=complete --with-thread --with-regex
--with-system --with-date_time --with-test --with-filesystem --with-chrono
--with-program_options address-model=32 install*

Add C:\Boost\lib to PATH



Unpack Cucumber-cpp and Install and run CMake

=============================================

2. Unpack cucumber-cpp zip to <cucumber-cpp>-dir



Install CMake from cmake-2.8.12.2-win32-x86.exe, *http://www.cmake.org/cmake/resources/software.html
<http://www.cmake.org/cmake/resources/software.html>*


And do the following:

Cd <cucumber-cpp>

cmake -E make_directory vsprj

cmake -E chdir vsprj cmake -G"Visual Studio 11" -DCUKE_ENABLE_EXAMPLES=on
-DBOOST_ROOT=c:\Boost ..



Build in Visual Studio 2012: <cucumber-cpp>\vsprj\Cucumber-Cpp.sln



Run cucumber

============



a) Run the cucumber-cpp listener



cd <cucumber-cpp>\vsprj\examples\Calc\Debug

start BoostCalculatorSteps.exe



b) Run features



cd <cucumber-cpp>\examples\Calc

cucumber features



c) Enjoy!
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Monika Parvanda
2018-09-13 05:44:17 UTC
Permalink
Hi Sanda

I am getting this error while builing cucumber_cpp
7>c1xx : fatal error C1083: Cannot open source file:
'C:\Cucumber\cucumber-cpp\vsprj\tmp\test_features\step_definitions\cpp_steps.cpp':
No such file or directory

Do you have any idea about this.
Post by 'Sanda Aitonean' via Cukes
Hello,
I am new to the BDD world, want to try-out Cucumber-cpp in an Windows 7
environment, but don’t know how to proceed after having built its sources
(how to get to the server needed to be launched in order to run the example
features)
I followed instructions from
http://infowarestudios.co.za/agile-testing-getting-agile-tests-incorporated-into-your-sprints-using-bdd-and-cucumber-in-c/,
but not all worked exactly as described there.
I understand that: in order to use Cucumber-cpp, first I need to
install/build its prerequisites, then build the Cucumber-Cpp sources to a
library, and ultimately create my step definition files (C++) and build
them against the Cucumber-cpp library. In order to run my feature files, I
should be starting a server (is this an executable resulting from the build
of Cucumber-cpp sources, or is it something I should be creating myself?)
that ‘talks’ to the ruby implementation of Cucumber, allowing it to
interpret C++ written steps. (Hope there is some true in the above.)
- rubyinstaller-1.9.3-p545.exe from http://rubyinstaller.org/
- cucumber gem 1.3.16 and its dependencies –had to install them
manually (‘gem install cucumber’ command fails – proxy/firewall prevents
downloads) from *http <http://rubygems.org/gems/cucumber>://
<http://rubygems.org/gems/cucumber>rubygems.org/gems/cucumber
<http://rubygems.org/gems/cucumber>*. Note: installation of the gherkin
DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe, *https://
<https://github.com/oneclick/rubyinstaller/wiki/Development-Kit>github.com/oneclick/rubyinstaller/wiki/Development-Kit
<https://github.com/oneclick/rubyinstaller/wiki/Development-Kit>*
1. Get *Cucumber-cpp sources* to c:\Cucumber\cucumber-cpp, from
https://github.com/cucumber/cucumber-cppn(cucumber-cpp-master.zip,
latest commit 515e398047)
2. Build* Boost *sources, version 1.55.0, from http://www.boost.org/
*c:\Boost\boost_1_55_0>bootstrap.bat*
* c:\Boost\boost_1_55_0>.\b2 --prefix=C:\Boost
--build-type=complete address-model=32 install*
4. Install *Cmake,* cmake-2.8.12.2-win32-x86.exe from *http://www.cmake.org/cmake/resources/software.html
<http://www.cmake.org/cmake/resources/software.html>*
5. Obtain a solution file (.sln) for the *cucumber-Cpp* library
and example
*cd c:\Cucumber\cucumber-cpp cmake -E make_directory vsprj*
* c:\Cucumber\cucumber-cpp>cmake -E chdir vsprj cmake -G
"Visual Studio 11" -DCUKE_ENABLE_EXAMPLES=on -DBOOST_ROOT=c:\Boost . ..*
6. Build Cucumber-cpp.sln with VisualStudio 2012, after solving
some build errors, e.g. 'cannot open include file boost\shared_ptr.hpp' -
had to add to the include folders C:\Boost\include\boost-1_55
In order to run the features in the ‘Calculator’ example, I am supposed to
start a server which I don’t have (there is no BoostCalculatorSteps.exe in
folder vsprj\examples\Calc\Debug).
I read at
https://github.com/cucumber/cucumber-cpp/wiki/Primer#compiling-and-running that
I would need to configure the wire protocol; where would I have to do that
in order to run the Calculator example, and how does that relate to the
BoostCalculatorSteps.exe?
I would appreciate any help, thanks in advance,
Sanda
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...