Skip to content

Commit a5410b3

Browse files
committed
Reorganized examples directory
1 parent 56c8e05 commit a5410b3

29 files changed

+32
-19
lines changed

HISTORY.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### New Features
44

5+
* Added CalcQt example ([#58](https://github.com/cucumber/cucumber-cpp/pull/58) Gianni Ambrosio)
56
* Replaced USING_CONTEXT with ScenarioScope<T> ([27256e9](https://github.com/cucumber/cucumber-cpp/commit/27256e932c75e9d4d57d4839042317e6a04cfe46) Paolo Ambrosio)
67
* Changed include name from core.hpp to defs.hpp ([5bbac06](https://github.com/cucumber/cucumber-cpp/commit/5bbac062e19dcf9de2761f4ded115aa7212c14d7) Paolo Ambrosio)
78
* Project rename from CukeBins to Cucumber-Cpp ([efecfd0](https://github.com/cucumber/cucumber-cpp/commit/efecfd0813efa1b6d406c2fd0cd03d8a84bed3ff) Paolo Ambrosio)

examples/Calc/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
project(Calc)
22

3-
include_directories(${CUKE_INCLUDE_DIRS} Calc)
3+
include_directories(${CUKE_INCLUDE_DIRS} src)
44

5-
add_library(Calc Calc/Calculator)
5+
add_library(Calc src/Calculator)
66

77
if(GTEST_FOUND)
88
include_directories(${GTEST_INCLUDE_DIRS})
9-
add_executable(GTestCalculatorSteps CalcFeatures/GTestCalculatorSteps)
9+
add_executable(GTestCalculatorSteps features/step_definitions/GTestCalculatorSteps)
1010
target_link_libraries(GTestCalculatorSteps Calc ${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
1111
endif()
1212

1313
if(CPPSPEC_FOUND)
1414
include_directories(${CPPSPEC_INCLUDE_DIRS})
15-
add_executable(CppSpecCalculatorSteps CalcFeatures/CppSpecCalculatorSteps)
15+
add_executable(CppSpecCalculatorSteps features/step_definitions/CppSpecCalculatorSteps)
1616
target_link_libraries(CppSpecCalculatorSteps Calc ${CPPSPEC_LIBRARY} ${CUKE_LIBRARIES})
1717
endif()
1818

1919
if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
2020
include_directories(${Boost_INCLUDE_DIRS})
21-
add_executable(BoostCalculatorSteps CalcFeatures/BoostCalculatorSteps)
21+
add_executable(BoostCalculatorSteps features/step_definitions/BoostCalculatorSteps)
2222
target_link_libraries(BoostCalculatorSteps Calc ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${CUKE_LIBRARIES})
2323
endif()
File renamed without changes.
File renamed without changes.

examples/CalcQt/CMakeLists.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ find_package(Qt4 COMPONENTS QtCore QtGui QtTest)
44

55
if(QT4_FOUND)
66
include(${QT_USE_FILE})
7-
set(CALCQT_HEADERS CalcQt/CalculatorWidget.h)
7+
set(CALCQT_HEADERS src/CalculatorWidget.h)
88
qt4_wrap_cpp(CALCQT_HEADERS_MOC ${CALCQT_HEADERS})
9-
include_directories(${CUKE_INCLUDE_DIRS} CalcQt)
10-
add_library(CalcQt CalcQt/CalculatorWidget ${CALCQT_HEADERS_MOC})
11-
9+
include_directories(${CUKE_INCLUDE_DIRS} src)
10+
add_library(CalcQt src/CalculatorWidget ${CALCQT_HEADERS_MOC})
11+
1212
if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
1313
include_directories(${Boost_INCLUDE_DIRS})
14-
add_executable(BoostCalculatorQtSteps CalcQtFeatures/BoostCalculatorQtSteps)
14+
add_executable(BoostCalculatorQtSteps features/step_definitions/BoostCalculatorQtSteps)
1515
target_link_libraries(BoostCalculatorQtSteps CalcQt ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${CUKE_LIBRARIES} ${QT_LIBRARIES})
1616
endif()
17-
18-
set(CALCQT_SOURCES CalcQt/CalcQt.cpp CalcQt/CalculatorWidget.cpp)
17+
18+
set(CALCQT_SOURCES src/CalcQt.cpp src/CalculatorWidget.cpp)
1919
add_executable(calcqt ${CALCQT_SOURCES} ${CALCQT_HEADERS_MOC})
2020
target_link_libraries(calcqt ${QT_LIBRARIES})
21-
endif()
21+
endif()

examples/CalcQt/README.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This sample shows how to test a QT GUI. The environment variable
2+
CALCQT_STEP_DELAY allows to introduce delays in the step execution for
3+
demo purposes (i.e. CALCQT_STEP_DELAY=100 ./BoostCalculatorQtSteps)
4+
File renamed without changes.

examples/FeatureShowcase/CMakeLists.txt

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ include_directories(${CUKE_INCLUDE_DIRS})
55
if(GTEST_FOUND)
66
include_directories(${GTEST_INCLUDE_DIRS})
77

8-
add_executable(TagSteps tag/TagSteps)
9-
target_link_libraries(TagSteps ${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
8+
function(add_cucumber_executable)
9+
add_executable(FeatureShowcaseSteps ${ARGV})
10+
target_link_libraries(FeatureShowcaseSteps ${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
11+
foreach(_arg ${ARGN})
12+
get_filename_component(OBJECT_PREFIX ${_arg} NAME_WE)
13+
set_source_files_properties(${_arg} PROPERTIES COMPILE_FLAGS "-DCUKE_OBJECT_PREFIX=${OBJECT_PREFIX}")
14+
endforeach(_arg)
15+
endfunction()
1016

11-
add_executable(TableSteps table/TableSteps)
12-
target_link_libraries(TableSteps ${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
17+
add_cucumber_executable(
18+
features/step_definitions/TagSteps
19+
features/step_definitions/TableSteps
20+
)
1321
endif()
1422

examples/FeatureShowcase/README.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This sample shows a few advanced features: tags and table arguments.
2+

examples/FeatureShowcase/tag/features/step_definitions/cucumber.wire

-2
This file was deleted.

0 commit comments

Comments
 (0)