-
Notifications
You must be signed in to change notification settings - Fork 136
Appveyor - windows CI #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
29dc152
e2de968
c2d92ae
6d5087b
8a9f675
9adc18b
89b276c
756f56a
37afea3
7ebb8ac
24ee3c9
9acca90
4173c0e
da603cf
0fda9a3
cbda64b
1d2ea5c
12049fb
f724c31
a2ed39a
323e10d
2e2804e
636fc5c
7e931ed
083e989
5306e2a
0451c0a
6f1cf08
d1b26c7
69cad5a
268bfe0
51d0f6b
dac49ff
c395e79
1b29ec4
a6b84c4
17339f2
f9ed162
8af63cf
9bf4717
073a450
2debcb0
40a4171
29ea93f
b490d92
e3352a4
bffbb34
844b720
9f1c891
e3d3edf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# vim swap files | ||
*.swp | ||
# Qt Creator | ||
CMakeLists.txt.user | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "features/cucumber-tck"] | ||
path = features/cucumber-tck | ||
url = git://github.com/cucumber/cucumber-tck.git | ||
url = https://github.com/konserw/cucumber-tck.git | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,7 @@ script: ./travis.sh | |
notifications: | ||
email: | ||
- cukes-devs@googlegroups.com | ||
|
||
branches: | ||
only: | ||
- master |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,27 @@ if(CMAKE_COMPILER_IS_GNUCXX) | |
# 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") | ||
add_definitions(-DNOMINMAX) # exclude M$ min/max macros | ||
add_definitions(-D_SCL_SECURE_NO_WARNINGS) #turn off msvc warning | ||
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) #likewise | ||
# link_directories("C:/Libraries/boost/lib32-msvc-12.0") | ||
# add_definitions(-D_WIN32_WINNT=0x0600) #windows vista | ||
set(variables | ||
CMAKE_C_FLAGS_DEBUG | ||
CMAKE_C_FLAGS_MINSIZEREL | ||
CMAKE_C_FLAGS_RELEASE | ||
CMAKE_C_FLAGS_RELWITHDEBINFO | ||
CMAKE_CXX_FLAGS_DEBUG | ||
CMAKE_CXX_FLAGS_MINSIZEREL | ||
CMAKE_CXX_FLAGS_RELEASE | ||
CMAKE_CXX_FLAGS_RELWITHDEBINFO | ||
) | ||
foreach(variable ${variables}) | ||
if(${variable} MATCHES "/MD") | ||
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}") | ||
endif() | ||
endforeach() | ||
endif() | ||
|
||
# | ||
|
@@ -47,22 +66,28 @@ if(NOT CUKE_DISABLE_BOOST_TEST) | |
endif() | ||
|
||
if(CUKE_USE_STATIC_BOOST) | ||
message(STATUS "Using 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 CUKE_DISABLE_BOOST_TEST) | ||
set(CUKE_DYNAMIC_BOOST_LIBS ${CUKE_TEST_BOOST_LIBS}) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_TEST_DYN_LINK") | ||
endif() | ||
|
||
if(NOT MSVC) | ||
find_package(Threads) | ||
set(CUKE_EXTRA_LIBRARIES ${CUKE_EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) | ||
endif() | ||
else() | ||
message(STATUS "Using DYNAMIC BOOST") | ||
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) | ||
set(Boost_USE_STATIC_RUNTIME ON) | ||
set (Boost_MULTITHREADED ON) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this related to static linking and to the Windows build? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - on windows only way I could get it running was to statically (with multithread - /MT) link everything |
||
find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS ${CUKE_STATIC_BOOST_LIBS}) | ||
endif() | ||
|
||
|
@@ -148,16 +173,18 @@ if(NOT CUKE_DISABLE_FUNCTIONAL) | |
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") | ||
|
||
set(CUKE_COMPILE_DYNAMIC_CPP_STEPS "cmake --build ${CMAKE_BINARY_DIR} --target functional-steps") | ||
if(VERBOSE) | ||
message(STATUS, "compile dnamic steps command: ${CUKE_COMPILE_DYNAMIC_CPP_STEPS}") | ||
message(STATUS, "cucumber: ${CUCUMBER_RUBY}") | ||
endif() | ||
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 | ||
DYNAMIC_CPP_STEPS_EXE="${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/functional-steps" | ||
COMPILE_DYNAMIC_CPP_STEPS=${CUKE_COMPILE_DYNAMIC_CPP_STEPS} | ||
${ARGV1} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5} ${ARGV6} | ||
${CUKE_FEATURES_DIR} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
source 'https://rubygems.org' | ||
|
||
group :test do | ||
gem 'cucumber', "=1.3.20" | ||
gem 'aruba', "=0.6.1" | ||
gem 'rspec', "=2.14.1" | ||
gem 'cucumber', "=2.0.0" | ||
gem 'aruba', "=0.8.0" | ||
gem 'rspec', "=3.4.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK as a separate PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this is in #93 already! |
||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: "{branch}-ci-{build}" | ||
os: | ||
- Visual Studio 2013 | ||
|
||
platform: | ||
- Win32 | ||
|
||
configuration: | ||
- Debug | ||
- Release | ||
|
||
on_finish: | ||
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) | ||
|
||
environment: | ||
matrix: | ||
- BOOST_ROOT: C:\Libraries\boost | ||
BOOST_INCLUDEDIR: C:\Libraries\boost\boost | ||
BOOST_LIBRARYDIR: C:\Libraries\boost\lib32-msvc-12.0 | ||
ruby_version: "193" | ||
- BOOST_ROOT: C:\Libraries\boost_1_58_0 | ||
BOOST_INCLUDEDIR: C:\Libraries\boost_1_58_0\boost | ||
BOOST_LIBRARYDIR: C:\Libraries\boost_1_58_0\lib32-msvc-12.0 | ||
ruby_version: "200" | ||
|
||
install: | ||
- git submodule init | ||
- git submodule update | ||
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH% | ||
- ruby --version | ||
- gem update --system --no-ri --no-rdoc -q > gem.log | ||
- gem install gem-shut-the-fuck-up | ||
- gem install bundler --no-document | ||
- bundle install | ||
- ps: .\fixCucumber.ps1 | ||
|
||
build_script: | ||
- cmake -E make_directory build | ||
- cmake -E chdir build cmake -DAPPVEYOR=on -DVERBOSE=on -DCUKE_ENABLE_EXAMPLES=on -DCUKE_DISABLE_BOOST_TEST=on -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_INCLUDEDIR="%BOOST_INCLUDEDIR%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" .. | ||
- cmake --build build | ||
|
||
test_script: | ||
- cmake --build build --target RUN_TESTS | ||
- cmake --build build --target features | ||
|
||
notifications: | ||
- provider: Email | ||
to: | ||
- cukes-devs@googlegroups.com | ||
subject: "[cucumber-cpp] AppVeyor Build {version}" | ||
on_build_success: false | ||
on_build_failure: true | ||
on_build_status_changed: true |
+39 −1 | i18n.feature | |
+1 −1 | step_definitions/cucumber_mappings.rb | |
+7 −9 | step_definitions/cucumber_stepdefs.rb |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# encoding: utf-8 | ||
|
||
require 'json' | ||
|
||
module CucumberCppMappings | ||
|
@@ -131,33 +133,47 @@ def write_mapping_calling_world_function(step_name) | |
EOF | ||
end | ||
|
||
def assert_returned_success | ||
expect(@return).to be == true | ||
end | ||
|
||
def assert_passing_feature | ||
assert_no_partial_output("failed", @output.encode('UTF-8')) | ||
expect(@return).to be == true | ||
end | ||
|
||
def assert_failing_feature(message) | ||
assert_partial_output(message, @output) | ||
expect(@return).to be == false | ||
end | ||
|
||
def assert_passing_scenario | ||
assert_partial_output("1 scenario (1 passed)", all_output) | ||
assert_success true | ||
assert_partial_output("1 scenario (1 passed)", @output) | ||
expect(@return).to be == true | ||
end | ||
|
||
def assert_failing_scenario | ||
assert_partial_output("1 scenario (1 failed)", all_output) | ||
assert_success false | ||
assert_partial_output("1 scenario (1 failed)", @output) | ||
expect(@return).to be == false | ||
end | ||
|
||
def assert_pending_scenario | ||
assert_partial_output("1 scenario (1 pending)", all_output) | ||
assert_success true | ||
assert_partial_output("1 scenario (1 pending)", @output) | ||
expect(@return).to be == true | ||
end | ||
|
||
def assert_undefined_scenario | ||
assert_partial_output("1 scenario (1 undefined)", all_output) | ||
assert_success true | ||
assert_partial_output("1 scenario (1 undefined)", @output) | ||
expect(@return).to be == true | ||
end | ||
|
||
def assert_scenario_reported_as_failing(scenario_name) | ||
assert_partial_output("# Scenario: #{scenario_name}", all_output) | ||
assert_success false | ||
assert_partial_output("# Scenario: #{scenario_name}", @output) | ||
expect(@return).to be == false | ||
end | ||
|
||
def assert_scenario_not_reported_as_failing(scenario_name) | ||
assert_no_partial_output("# Scenario: #{scenario_name}", all_output) | ||
assert_no_partial_output("# Scenario: #{scenario_name}", @output) | ||
end | ||
|
||
def assert_suggested_step_definition_snippet(stepdef_keyword, stepdef_pattern, parameter_count = 0, doc_string = false, data_table = false) | ||
|
@@ -172,36 +188,34 @@ 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 | ||
expect(File.read("#{WORLD_VARIABLE_LOG_FILE}.#{time}")).to match value | ||
end | ||
|
||
def assert_world_function_called | ||
check_file_presence [WORLD_FUNCTION_LOG_FILE], true | ||
expect(File.file?(WORLD_FUNCTION_LOG_FILE)).to be true | ||
end | ||
|
||
def assert_cycle_sequence *args | ||
expected_string = args.join CYCLE_SEQUENCE_SEPARATOR | ||
check_file_content(CYCLE_LOG_FILE, expected_string, true) | ||
expect(File.read(CYCLE_LOG_FILE)).to match expected_string | ||
end | ||
|
||
def assert_cycle_sequence_excluding *args | ||
args.each do |unexpected_string| | ||
check_file_content(CYCLE_LOG_FILE, unexpected_string, false) | ||
expect(File.read(CYCLE_LOG_FILE)).not_to match unexpected_string | ||
end | ||
end | ||
|
||
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) | ||
expect(File.read(CYCLE_LOG_FILE)).to match expected_string | ||
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 | ||
end | ||
log_file_contents = File.read(DATA_TABLE_LOG_FILE) | ||
actual_array = JSON.parse(log_file_contents) | ||
expected_array = JSON.parse(json) | ||
expect(actual_array).to be == expected_array | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
end | ||
|
||
def run_feature | ||
|
@@ -292,8 +306,11 @@ 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(9, @steps_out.pid) | ||
Process.wait @steps_out.pid | ||
rescue Errno::ESRCH | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've introduced something similar as an after hook in PR #102 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take it from there ;) |
||
end | ||
|
||
def write_main_step_definitions_file | ||
|
@@ -302,7 +319,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 | ||
|
@@ -317,7 +334,9 @@ def run_cucumber_cpp | |
end | ||
|
||
def run_cucumber_test_feature(params) | ||
run_simple "cucumber #{params} #{FEATURES_DIR}", false | ||
cmd="cucumber #{params} #{FEATURES_DIR}" | ||
@output = %x[ #{cmd} ] | ||
@return = ($?.success?) | ||
end | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
If ($env:ruby_version -match "200") { | ||
$path = "C:\Ruby200\lib\ruby\gems\2.0.0\gems\cucumber-2.0.0\lib\cucumber\formatter\ansicolor.rb" | ||
} Else { | ||
$path = "C:\Ruby193\lib\ruby\gems\1.9.1\gems\cucumber-2.0.0\lib\cucumber\formatter\ansicolor.rb" | ||
} | ||
|
||
(Get-Content $path) -replace '\ST\DERR.puts %', '#nope' | Set-Content $path | ||
(Get-Content $path) -replace ' Cucumber::', '#nope' | Set-Content $path | ||
(Get-Content $path) -replace '^Cucumber::', '#nope' | Set-Content $path |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#include <cucumber-cpp/internal/drivers/GTestDriver.hpp> | ||
|
||
#include <gtest/gtest.h> | ||
#include "gtest/gtest.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So AFAIK when using "" in theory we prioritise current directory over system defined paths when searching for header. |
||
|
||
namespace cucumber { | ||
namespace internal { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to upgrade to the latest Cucumber/RSpec/Aruba, right? I'll create a branch in
cucumber-tck
for that so that we can reference an official branch. I also think this deserves its own PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created branch
cucumber-cpp
incucumber-tck
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created PR cucumber-attic/cucumber-tck#19