Skip to content

Commit

Permalink
Fix building without features
Browse files Browse the repository at this point in the history
* Fix #3684 - CLI Yubikey is skipped when Yubikey feature is not enabled

* Skip building testguibrowser if browser integration is disabled
  • Loading branch information
droidmonkey committed Oct 28, 2019
1 parent 1ab8a9f commit 5f734dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/TestCli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,7 @@ void TestCli::testInvalidDbFiles()
*/
void TestCli::testYubiKeyOption()
{
#ifdef WITH_XC_YUBIKEY
if (!YubiKey::instance()->init()) {
QSKIP("Unable to connect to YubiKey");
}
Expand Down Expand Up @@ -1854,6 +1855,9 @@ void TestCli::testYubiKeyOption()
m_stderrFile->seek(posErr);
QCOMPARE(m_stdoutFile->readAll(), QByteArray(""));
QCOMPARE(m_stderrFile->readAll().split(':').at(0), QByteArray("Invalid YubiKey slot 3\n"));
#else
QSKIP("Yubikey feature is disabled.");
#endif
}

namespace
Expand Down
5 changes: 4 additions & 1 deletion tests/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)

add_unit_test(NAME testgui SOURCES TestGui.cpp ../util/TemporaryFile.cpp LIBS ${TEST_LIBRARIES})
add_unit_test(NAME testguibrowser SOURCES TestGuiBrowser.cpp ../util/TemporaryFile.cpp LIBS ${TEST_LIBRARIES})
add_unit_test(NAME testguipixmaps SOURCES TestGuiPixmaps.cpp LIBS ${TEST_LIBRARIES})

if(WITH_XC_BROWSER)
add_unit_test(NAME testguibrowser SOURCES TestGuiBrowser.cpp ../util/TemporaryFile.cpp LIBS ${TEST_LIBRARIES})
endif()

0 comments on commit 5f734dd

Please sign in to comment.