Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2e09eb6
Fix unused parameter warnings about unused parameters
hvellyr Jan 27, 2014
5b0ea92
Fix compiler warnings about missing virtual destructors
hvellyr Jan 27, 2014
3bb7d32
Fix compiler warning about useless const on returntype
hvellyr Jan 27, 2014
fab7724
Fix compiler warning about type mismatch
hvellyr Jan 27, 2014
e4414cf
Fix compiler warning about inlined static function
hvellyr Jan 27, 2014
0e76db6
Fix compiler warning about hidden virtual function definition
hvellyr Jan 27, 2014
bc2cd11
Fix compiler warning about member initializer order
hvellyr Jan 27, 2014
bdcc9e2
Fix building with newer boost version
hvellyr Jan 27, 2014
5a409f7
Fix compiler warning when building with newer boost
hvellyr Jan 27, 2014
663fa4b
Give access to the number of args in InvokeArgs to support arg forwar…
hvellyr Jan 27, 2014
fa77eac
Avoid build warning about nested comments on Visual studio
gck-ableton Feb 27, 2014
2a6cd53
Added script run.sh to cleanup previous build and build cucumber with…
konserw Jan 10, 2016
fc52985
update apt-get database before install
konserw Jan 10, 2016
4a8a81d
fixing gmock ang travis script execution?
konserw Jan 10, 2016
d72b7ba
fix running travis script
Jan 10, 2016
17933a0
fix travis.yaml
Jan 10, 2016
dba01a5
Update to use latest Cucumber-Ruby and RSpec matchers
paoloambrosio Jun 21, 2014
ff1ad75
et cucumber = 1.3.20
konserw Jan 10, 2016
b896715
gtest and gmock as subproject
konserw Jan 10, 2016
de51ee9
do not download and build gmock & gtest systemwide
konserw Jan 10, 2016
aa6aa1e
Merge remote-tracking branch 'hvellyr/master' into upstream_travis
konserw Jan 10, 2016
72d6dcc
fix some deprected functions
konserw Jan 8, 2016
1226cf3
change apt-get to addons: apt: packages:
konserw Jan 10, 2016
c847396
removed unused cmake module
konserw Jan 11, 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
28 changes: 22 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
language: cpp

sudo: required
dist: trusty
os:
- linux
- osx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's create a pull request only for OSX (it's not working)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

compiler:
- clang
- gcc
rvm:
- 1.9.3
- 2.0
- 2.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not seem to work (always runs with 2.2.3), probably because it's a c++ project

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After all Ruby deps are there just to run our tests. We shouldn't be concerned with testing multiple Ruby versions. Let's just choose one thst works with rvm (.ruby-version).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - I noticed that it doesn't work. And agree that it is probably because it's not ruby project for travis. I left it there to think about it later, but then forgot about that...
I agree that we shouldn't be concerned with testing multiple Ruby versions.
I believe we can just depend on ruby version preinstalled on CI (if it works)

addons:
apt:
# List of whitelisted in travis packages for ubuntu-precise can be found here:
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
# List of whitelisted in travis apt-sources:
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think comments are needed here: the whitelisting process is quite clear in the Travis documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. TBH it was copy-paste from google-test .travis.yml

packages:
- libboost-thread-dev
- libboost-system-dev
- libboost-regex-dev
- libboost-date-time-dev
- libboost-test-dev

before_script:
- "sudo apt-get install libboost-thread-dev libboost-system-dev libboost-regex-dev libboost-date-time-dev libboost-test-dev google-mock"
- "cd /usr/src/gtest && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/ ; cd -"

script: "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"
script: ./travis.sh
61 changes: 51 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.8.12)

project(Cucumber-Cpp)

Expand Down Expand Up @@ -86,22 +86,63 @@ endif()
#

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()
if(UNIX)
find_package(Threads REQUIRED) # GTest needs this and it's a static library
endif()

#Gtest as externalproject

# Enable ExternalProject CMake module
include(ExternalProject)

# Download and install GoogleMock
ExternalProject_Add(
gmock
URL https://googlemock.googlecode.com/files/gmock-1.7.0.zip
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gmock
# Disable install step
INSTALL_COMMAND ""
# Wrap download, configure and build steps in a script to log output
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
)
# Create a libgmock target to be used as a dependency by test programs
add_library(libgmock IMPORTED STATIC GLOBAL)
add_dependencies(libgmock gmock)

# Set gmock properties
ExternalProject_Get_Property(gmock source_dir binary_dir)
set_target_properties(libgmock PROPERTIES
"IMPORTED_LOCATION" "${binary_dir}/libgmock.a"
"IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
# "INTERFACE_INCLUDE_DIRECTORIES" "${source_dir}/include"
)
set(GMOCK_INCLUDE_DIRS ${source_dir}/include)
set(GTEST_INCLUDE_DIRS ${source_dir}/gtest/include)

if(MSVC)
set(Suffix ".lib")
else()
set(Suffix ".a")
endif()
set(CUKE_GTEST_LIBRARIES
"${binary_dir}/gtest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${Suffix}"
${CMAKE_THREAD_LIBS_INIT}
)
set(CUKE_GMOCK_LIBRARIES
"${binary_dir}/gtest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${Suffix}"
"${binary_dir}/libgmock${Suffix}"
"${binary_dir}/libgmock_main${Suffix}"
${CMAKE_THREAD_LIBS_INIT}
)
endif()

#
# Cucumber-Cpp
#

set(CUKE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(CUKE_INCLUDE_DIR ${CUKE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)

include_directories(${CUKE_INCLUDE_DIR})

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

group :test do
gem 'cucumber', "=1.3.6"
gem 'cucumber', "=1.3.20"
gem 'aruba'
gem 'rspec'
end
Expand Down
113 changes: 0 additions & 113 deletions cmake/modules/FindGMock.cmake

This file was deleted.

4 changes: 2 additions & 2 deletions examples/Calc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ include_directories(${CUKE_INCLUDE_DIRS} src)

add_library(Calc src/Calculator)

if(GTEST_FOUND)
if(NOT CUKE_DISABLE_GTEST)
include_directories(${GTEST_INCLUDE_DIRS})
add_executable(GTestCalculatorSteps features/step_definitions/GTestCalculatorSteps)
target_link_libraries(GTestCalculatorSteps Calc ${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
target_link_libraries(GTestCalculatorSteps Calc ${CUKE_LIBRARIES} ${CUKE_GTEST_LIBRARIES})
endif()

if(CPPSPEC_FOUND)
Expand Down
4 changes: 2 additions & 2 deletions examples/FeatureShowcase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ project(FeatureShowcase)

include_directories(${CUKE_INCLUDE_DIRS})

if(GTEST_FOUND)
if(NOT CUKE_DISABLE_GTEST)
include_directories(${GTEST_INCLUDE_DIRS})

function(add_cucumber_executable)
add_executable(FeatureShowcaseSteps ${ARGV})
target_link_libraries(FeatureShowcaseSteps ${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
target_link_libraries(FeatureShowcaseSteps ${CUKE_LIBRARIES} ${CUKE_GTEST_LIBRARIES})
foreach(_arg ${ARGN})
get_filename_component(OBJECT_PREFIX ${_arg} NAME_WE)
set_source_files_properties(${_arg} PROPERTIES COMPILE_FLAGS "-DCUKE_OBJECT_PREFIX=${OBJECT_PREFIX}")
Expand Down
10 changes: 5 additions & 5 deletions features/step_definitions/cucumber_cpp_mappings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ def assert_executed_scenarios *scenario_offsets
end

def assert_world_variable_held_value_at_time(value, time)
check_exact_file_content "#{WORLD_VARIABLE_LOG_FILE}.#{time}", value
check_file_content("#{WORLD_VARIABLE_LOG_FILE}.#{time}", value, true)
end

def assert_world_function_called
check_file_presence [WORLD_FUNCTION_LOG_FILE], true
expect(WORLD_FUNCTION_LOG_FILE).to be_existing_file
end

def assert_cycle_sequence *args
Expand All @@ -192,15 +192,15 @@ def assert_cycle_sequence_excluding *args

def assert_complete_cycle_sequence *args
expected_string = "#{CYCLE_SEQUENCE_SEPARATOR}#{args.join(CYCLE_SEQUENCE_SEPARATOR)}"
check_exact_file_content(CYCLE_LOG_FILE, expected_string)
check_file_content(CYCLE_LOG_FILE, expected_string, true)
end

def assert_data_table_equals_json(json)
prep_for_fs_check do
log_file_contents = IO.read(DATA_TABLE_LOG_FILE)
actual_array = JSON.parse(log_file_contents)
expected_array = JSON.parse(json)
actual_array.should == expected_array
expect(actual_array).to be == expected_array
end
end

Expand Down Expand Up @@ -302,7 +302,7 @@ def write_main_step_definitions_file

def compile_step_definitions
compiler_output = %x[ #{COMPILE_STEP_DEFINITIONS_CMD} ]
expect($?.success?).to be_true, "Compilation failed!\n#{compiler_output}"
expect($?.success?).to be == true, "Compilation failed!\n#{compiler_output}"
end

def create_wire_file
Expand Down
2 changes: 1 addition & 1 deletion include/cucumber-cpp/internal/hook/HookRegistrar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BeforeHook : public Hook {

class AroundStepHook : public Hook {
public:
virtual void invokeHook(Scenario *scenario, CallableStep *step);
virtual void invokeHookWithStep(Scenario *scenario, CallableStep *step);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this name change? there is only one invokeHook and I don't see the point of renaming it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is from pull request #72

virtual void skipHook();
protected:
CallableStep *step;
Expand Down
1 change: 1 addition & 0 deletions include/cucumber-cpp/internal/hook/Tag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class TagExpression {
public:
typedef std::vector<std::string> tag_list;

virtual ~TagExpression() { }
virtual bool matches(const tag_list &tags) = 0;
};

Expand Down
9 changes: 7 additions & 2 deletions include/cucumber-cpp/internal/step/StepManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ class InvokeArgs {

template<class T> T getInvokeArg(size_type i) const;
const Table & getTableArg() const;

size_type argsSize() const {
return args.size();
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is from pull request #72

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, sorry to chime in here. I've used this extension in other code, not pushed or published anywhere (yet). I needed it to pass it on to another code layer (if I recall correctly).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say it belongs to a PR of its own (but it's hard to know if it makes sense without knowing what it should be used for) or it should live in your own branch. It didn't make any sense fixing the compiler warnings or in the OSX build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I guess I've to rebase my stuff on master once all this and other fixes landed. I've to review my code (which laid dormant for some time now), and will check what this function was required for. In the context of the other changes this should be dropped therefore (I guess)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the Boost improvements that should have come from another PR, I think this is the only change that I didn't apply in #107. Once that is merged, it's probably easier to apply this single change on top of master instead of rebasing (that took me quite some time).

private:
Table tableArg;
args_type args;
Expand Down Expand Up @@ -91,7 +96,7 @@ class InvokeResult {

bool isSuccess() const;
bool isPending() const;
const InvokeResultType getType() const;
InvokeResultType getType() const;
const std::string &getDescription() const;
};

Expand Down Expand Up @@ -157,7 +162,7 @@ class StepManager {
};


static std::string toSourceString(const char *filePath, const int line) {
static inline std::string toSourceString(const char *filePath, const int line) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what kind of performance improvement do you expect by inlining this? or was it done for a different reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is from pull request #72

using namespace std;
stringstream s;
string file(filePath);
Expand Down
3 changes: 3 additions & 0 deletions include/cucumber-cpp/internal/utils/Regex.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#ifndef CUKE_REGEX_HPP_
#define CUKE_REGEX_HPP_

#include <string>
#include <vector>

#define BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP

#include <boost/regex.hpp>

namespace cucumber {
Expand Down
13 changes: 13 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#rvm install 2.2
ruby -v
gem install bundler
rm Gemfile.lock
rm build -rf
cmake -E make_directory build
cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on -DCUKE_DISABLE_BOOST_TEST=on ..
cmake --build build
cmake --build build --target test
cmake --build build --target features
build/examples/Calc/GTestCalculatorSteps >/dev/null &
cucumber examples/Calc
killall GTestCalculatorSteps
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(CUKE_SOURCES
connectors/wire/WireProtocolCommands.cpp
)

if(GTEST_FOUND)
if(NOT CUKE_DISABLE_GTEST)
include_directories(${GTEST_INCLUDE_DIRS})
list(APPEND CUKE_SOURCES drivers/GTestDriver.cpp)
endif()
Expand Down
Loading