Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7a43ea1
add option parser for wireserver
Lemutar Jun 10, 2014
9255936
remove old parser from wirde server
Lemutar Jun 10, 2014
796b569
Update main.cpp
Lemutar Jun 10, 2014
da603cf
do not build this branch
konserw Feb 7, 2016
0754b4b
add osx build
konserw Feb 11, 2016
4c28008
disable gcc on osx
konserw Feb 11, 2016
8b9f18c
try to fix gtest 1.6 on osx
konserw Feb 11, 2016
a16bbc1
fix cmake
konserw Feb 11, 2016
5821b96
remove own tuple
konserw Feb 11, 2016
c29c7db
Revert "remove own tuple"
konserw Feb 11, 2016
43e8f71
opsite combination?
konserw Feb 11, 2016
79872d2
Revert "opsite combination?"
konserw Feb 11, 2016
e6c153e
spceial defines only for gtest 1.6, add variadic max?
konserw Feb 11, 2016
17616b9
another try
konserw Feb 11, 2016
1a6e61f
fix typo
konserw Feb 11, 2016
ea9f907
another try
konserw Feb 11, 2016
cc33bc8
gmock 1.6 on osx does not build
konserw Feb 11, 2016
033bce9
retry
konserw Feb 14, 2016
cbb2db5
first try on suggested resolution from #96 for failing features targe…
konserw Feb 15, 2016
c35abc5
Merge branch 'master' of https://github.com/Lemutar/cucumber-cpp into…
konserw Feb 15, 2016
222d82f
fix CMAkelists for #73
konserw Feb 15, 2016
605219e
update boost section of readme
konserw Feb 15, 2016
4996630
should fix osx travis
konserw Feb 15, 2016
4fdc87c
fix travis.yml - missing boost program options in apt
konserw Feb 15, 2016
a13b1f7
add some debug output
konserw Feb 15, 2016
46b01ef
prettyprint features for debuging
konserw Feb 15, 2016
0932f56
change kill signal to int
konserw Feb 15, 2016
2424d95
Wait a second - add sleep
konserw Feb 15, 2016
69100f3
cleanup a little
konserw Feb 15, 2016
abc988b
another try using PTY module
konserw Feb 16, 2016
7f560ef
extend timeout
konserw Feb 16, 2016
dcb63c9
remove wait
konserw Feb 16, 2016
40677cf
delete object file on mac as workaround OSX issue
konserw Feb 29, 2016
a4b6169
fix cucumber-cpp specific feature
konserw Feb 29, 2016
25e5000
use normal, not pretty formatter
konserw Feb 29, 2016
c989879
fix path to object file
konserw Feb 29, 2016
a0b5634
build osx first
konserw Feb 29, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
language: cpp
os:
- osx
- linux
sudo: required
dist: trusty
compiler:
- clang
- gcc
env:
matrix:
- GMOCK_VER=1.7.0
- GMOCK_PATH=/usr/src/gmock #1.6.0 from ubuntu trusty repo

# - GMOCK_VER=1.6.0
- GMOCK_VER=1.7.0
- GMOCK_PATH=/usr/src/gmock #1.6.0 from ubuntu trusty repo
matrix:
exclude:
# - os: linux
# env: GMOCK_VER=1.6.0
- os: osx
env: GMOCK_PATH=/usr/src/gmock
- os: osx
compiler: gcc #does anyone on osx use it?
addons:
apt:
packages:
Expand All @@ -17,10 +27,15 @@ addons:
- libboost-regex-dev
- libboost-date-time-dev
- libboost-test-dev
- libboost-program-options-dev
- google-mock

script: ./travis.sh

notifications:
email:
- cukes-devs@googlegroups.com

branches:
only:
- master
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ else()
set(BOOST_MIN_VERSION "1.40")
endif()

set(CUKE_CORE_BOOST_LIBS thread system regex date_time)
set(CUKE_CORE_BOOST_LIBS thread system regex date_time program_options)
if(NOT CUKE_DISABLE_BOOST_TEST)
set(CUKE_TEST_BOOST_LIBS unit_test_framework)
endif()
Expand Down Expand Up @@ -73,7 +73,7 @@ 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})
set(CUKE_EXTRA_LIBRARIES ${CUKE_EXTRA_LIBRARIES} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
endif()

#
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ group :test do
gem 'cucumber', "=1.3.20"
gem 'aruba', "=0.6.1"
gem 'rspec', "=2.14.1"
gem 'os'
end

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ 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*.
* [Boost](http://www.boost.org/) 1.40 or later (1.51 for MSVC11).
Required libraries: *thread*, *system*, *regex*, *program_options* and *date_time*.
Optional library for Boost Test driver: *test*.
* [GTest](http://code.google.com/p/googletest/) 1.6 or later.
Optional for the GTest driver. By default downloaded and built by CMake.
Expand Down
13 changes: 10 additions & 3 deletions features/step_definitions/cucumber_cpp_mappings.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'json'
require 'os'

module CucumberCppMappings

Expand Down Expand Up @@ -292,15 +293,21 @@ def run_feature_with_params(params)
create_wire_file
run_cucumber_cpp
run_cucumber_test_feature params
Process.kill(:SIGTERM, @steps_out.pid) # for when there are no scenarios
Process.wait @steps_out.pid
begin
Process.kill(:SIGTERM, @steps_out.pid)
Process.wait @steps_out.pid
rescue Errno::ESRCH
end
end

def write_main_step_definitions_file
write_file(STEP_DEFINITIONS_SRC, @support_code);
end

def compile_step_definitions
if OS.mac?
File.delete("./CMakeFiles/functional-steps.dir/tmp/test_features/step_definitions/cpp_steps.cpp.o")
end
compiler_output = %x[ #{COMPILE_STEP_DEFINITIONS_CMD} ]
expect($?.success?).to be_true, "Compilation failed!\n#{compiler_output}"
end
Expand All @@ -313,7 +320,7 @@ def create_wire_file
end

def run_cucumber_cpp
@steps_out = IO.popen STEP_DEFINITIONS_EXE
@steps_out = IO.popen STEP_DEFINITIONS_EXE
end

def run_cucumber_test_feature(params)
Expand Down
41 changes: 33 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,57 @@
#include <cucumber-cpp/internal/connectors/wire/WireServer.hpp>
#include <cucumber-cpp/internal/connectors/wire/WireProtocol.hpp>
#include <iostream>
#include <boost/program_options.hpp>
using boost::program_options::value;

namespace {

void acceptWireProtocol(int port) {
void acceptWireProtocol(int port, bool verbose = false) {
using namespace ::cucumber::internal;
CukeEngineImpl cukeEngine;
JsonSpiritWireMessageCodec wireCodec;
WireProtocolHandler protocolHandler(&wireCodec, &cukeEngine);
SocketServer server(&protocolHandler);
server.listen(port);
if (verbose)
std::cerr << "Listening on port " << port << std::endl;
server.acceptOnce();
}

}

int main(int argc, char **argv) {
bool verbose = false;

boost::program_options::options_description optionDescription("Allowed options");
optionDescription.add_options()
("help,h", "help for cucumber-cpp")
("verbose,v", "verbose output")
("port,p", value<int>(), "listening port of wireserver")
;
boost::program_options::variables_map optionVariableMap;
boost::program_options::store( boost::program_options::parse_command_line(argc, argv, optionDescription), optionVariableMap);
boost::program_options::notify(optionVariableMap);

if (optionVariableMap.count("help")) {
std::cout << optionDescription << std::endl;
return 0;
}

if (optionVariableMap.count("verbose")) {
verbose = true;
}

int port = 3902;
if (optionVariableMap.count("port")) {
port = optionVariableMap["port"].as<int>();
}

try {
int port = 3902;
if (argc > 1) {
std::string firstArg(argv[1]);
port = ::cucumber::internal::fromString<int>(firstArg);
}
acceptWireProtocol(port);
acceptWireProtocol(port, verbose);
} catch (std::exception &e) {
std::cerr << e.what() << std::endl;
exit(1);
return 1;
}
return 0;
}