forked from cucumber/cucumber-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cucumber#283 from ursfassler/qt6
Add support for Qt6, keep Qt5, remove Qt4
- Loading branch information
Showing
19 changed files
with
319 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: build and test with Qt5 | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: setup environment | ||
run: | | ||
sudo apt-get install --no-install-recommends \ | ||
cmake \ | ||
g++ \ | ||
git \ | ||
libasio-dev \ | ||
libboost-test-dev \ | ||
libtclap-dev \ | ||
ninja-build \ | ||
nlohmann-json3-dev \ | ||
qtbase5-dev \ | ||
ruby \ | ||
ruby-dev | ||
- name: install ruby tools | ||
run: | | ||
sudo gem install bundler | ||
sudo bundle install | ||
- name: install gtest | ||
run: | | ||
git clone https://github.com/google/googletest.git | ||
cd googletest | ||
mkdir build | ||
cd build | ||
cmake ../ | ||
cmake --build . --parallel | ||
sudo cmake --install . | ||
- name: build | ||
run: | | ||
cmake -E make_directory build | ||
cmake -E chdir build cmake \ | ||
-G Ninja \ | ||
-DCUKE_ENABLE_BOOST_TEST=on \ | ||
-DCUKE_ENABLE_GTEST=on \ | ||
-DCUKE_ENABLE_QT_5=on \ | ||
-DCUKE_ENABLE_EXAMPLES=on \ | ||
-DCUKE_TESTS_UNIT=on \ | ||
.. | ||
cmake --build build --parallel | ||
- name: unit tests | ||
run: | | ||
cmake --build build --target test | ||
- name: QtCalc examples | ||
run: | | ||
for TEST in \ | ||
build/examples/CalcQt/GTestCalculatorQtSteps \ | ||
build/examples/CalcQt/QtTestCalculatorQtSteps \ | ||
build/examples/CalcQt/BoostCalculatorQtSteps \ | ||
; do | ||
"${TEST}" 2> /dev/null & | ||
sleep 1 | ||
(cd examples/CalcQt; cucumber) | ||
wait % | ||
done | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/Calc/features/step_definitions/FuncArgsCalculatorSteps.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
examples/Calc/src/Calculator.h → examples/Calc/src/Calculator.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#pragma once | ||
|
||
#include <list> | ||
|
||
class Calculator { | ||
private: | ||
std::list<double> values; | ||
|
||
public: | ||
void push(double); | ||
double add(); | ||
double divide(); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
project(CalcQt) | ||
|
||
if(TARGET Qt::Core AND TARGET Qt::Gui AND TARGET Qt::Widgets AND TARGET Qt::Test) | ||
add_library(libcalcqt STATIC src/CalculatorWidget.cpp src/CalculatorWidget.h) | ||
target_compile_options(libcalcqt PRIVATE "-Wno-deprecated-declarations") | ||
set_target_properties(libcalcqt PROPERTIES AUTOMOC ON) | ||
set(CMAKE_AUTOMOC ON) | ||
|
||
add_library(libcalcqt STATIC src/Calculator.cpp src/Calculator.hpp) | ||
target_include_directories(libcalcqt INTERFACE src) | ||
target_link_libraries(libcalcqt | ||
PUBLIC | ||
Qt::Core | ||
Qt::Widgets | ||
) | ||
|
||
add_executable(calcqt | ||
src/CalcQt.cpp | ||
src/CalculatorWidget.cpp | ||
src/CalculatorWidget.hpp | ||
) | ||
target_link_libraries(calcqt | ||
PRIVATE | ||
libcalcqt | ||
Qt::Core | ||
Qt::Gui | ||
Qt::Widgets | ||
) | ||
|
||
add_executable(calcqt src/CalcQt.cpp) | ||
target_link_libraries(calcqt PRIVATE libcalcqt Qt::Widgets) | ||
|
||
add_executable(QtTestCalculatorQtSteps features/step_definitions/QtTestCalculatorQtSteps.cpp) | ||
target_link_libraries(QtTestCalculatorQtSteps PRIVATE libcalcqt Qt::Test cucumber-cpp) | ||
|
||
if(TARGET Boost::unit_test_framework) | ||
add_executable(BoostCalculatorQtSteps features/step_definitions/BoostCalculatorQtSteps.cpp) | ||
target_link_libraries(BoostCalculatorQtSteps PRIVATE libcalcqt Boost::unit_test_framework cucumber-cpp Qt::Test) | ||
target_link_libraries(BoostCalculatorQtSteps PRIVATE libcalcqt Boost::unit_test_framework cucumber-cpp) | ||
endif() | ||
|
||
if(TARGET GTest::gtest) | ||
add_executable(GTestCalculatorQtSteps features/step_definitions/GTestCalculatorQtSteps.cpp) | ||
target_link_libraries(GTestCalculatorQtSteps PRIVATE libcalcqt cucumber-cpp GTest::gtest Qt::Test) | ||
target_link_libraries(GTestCalculatorQtSteps PRIVATE libcalcqt GTest::gtest cucumber-cpp) | ||
endif() | ||
|
||
endif() |
Oops, something went wrong.