Skip to content

Commit 414109f

Browse files
committed
[test] don't ignore possible timeout
Instead ASSERT that no timeout occurred and that the window has been shown. Then re-enable treating warnings as errors because this actually got caught by a warning. This fixes #192
1 parent 183c79d commit 414109f

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Please see [CONTRIBUTING.md](https://github.com./cucumber/cucumber/blob/master/CO
1616

1717
### Fixed
1818

19-
* Remove -werror compiler flag to fix failing build with clang ([#184](https://github.com./cucumber/cucumber-cpp/pull/184) Kamil Strzempowicz)
19+
* Fix compiler warning ([#192](https://github.com./cucumber/cucumber-cpp/issues/192) [Giel van Schijndel](https://github.com./muggenhor)), ([#184](https://github.com./cucumber/cucumber-cpp/pull/184) [Kamil Strzempowicz](https://github.com./konserw))
2020
* Add missing virtual destructor in base class SocketServer used by TCPSocketServer and UnixSocketServer ([#183](https://github.com./cucumber/cucumber-cpp/pull/183) Matthieu Longo)
2121
* Fix breaking changes in API of boost-1.66.0 ([#180](https://github.com./cucumber/cucumber-cpp/pull/180) Matthieu Longo)
2222
* Fix conflicting "using std" declaration with "using boost::thread" ([#181](https://github.com./cucumber/cucumber-cpp/pull/181) Matthieu Longo)

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
2727
#
2828

2929
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
30-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -Wextra ${CMAKE_CXX_FLAGS}")
30+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Werror -Wall -Wextra ${CMAKE_CXX_FLAGS}")
3131
# TODO: A better fix should handle ld's --as-needed flag
3232
if(UNIX AND NOT APPLE)
3333
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker '--no-as-needed'")
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <boost/test/unit_test.hpp>
22
// Pretend to be GTest
33
#define EXPECT_EQ BOOST_CHECK_EQUAL
4+
#define ASSERT_TRUE BOOST_REQUIRE
45
#include "CalculatorQtSteps.cpp"

examples/CalcQt/features/step_definitions/CalculatorQtSteps.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ GIVEN("^I just turned on the calculator$") {
3737
ctx->calculator.move(0, 0);
3838
ctx->calculator.show();
3939
#if QT_VERSION >= 0x050000
40-
QTest::qWaitForWindowExposed(&ctx->calculator);
40+
const bool window_shown = QTest::qWaitForWindowExposed(&ctx->calculator);
4141
#else
42-
QTest::qWaitForWindowShown(&ctx->calculator);
42+
const bool window_shown = QTest::qWaitForWindowShown(&ctx->calculator);
4343
#endif
44+
ASSERT_TRUE(window_shown);
4445
QTest::qWait(millisecondsToWait());
4546
}
4647

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <QTest>
22
// Pretend to be GTest
33
#define EXPECT_EQ QCOMPARE
4+
#define ASSERT_TRUE QVERIFY
45
#include "CalculatorQtSteps.cpp"

0 commit comments

Comments
 (0)