Remove WITH_GUI_TESTS exclusion for CLI tests (#6946)

Apparently this exclusion was only relevant for Linux
systems not running X, which was already handled dynamically
in the testClip function. The CLI tests will now run by default
will all the other core tests.
This commit is contained in:
louib 2021-09-26 06:36:54 -04:00 committed by GitHub
parent a46231a39a
commit 2b0a1fc63f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -236,11 +236,9 @@ if(WITH_XC_BROWSER)
LIBS ${TEST_LIBRARIES})
endif()
add_unit_test(NAME testcli SOURCES TestCli.cpp
LIBS testsupport cli ${TEST_LIBRARIES})
if(WITH_GUI_TESTS)
# CLI clip tests need X environment on Linux
add_unit_test(NAME testcli SOURCES TestCli.cpp
LIBS testsupport cli ${TEST_LIBRARIES})
add_subdirectory(gui)
endif(WITH_GUI_TESTS)

View File

@ -437,6 +437,10 @@ void TestCli::testAnalyze()
void TestCli::testClip()
{
if (QProcessEnvironment::systemEnvironment().contains("WAYLAND_DISPLAY")) {
QSKIP("Clip test skipped due to QClipboard and Wayland issues on Linux");
}
QClipboard* clipboard = QGuiApplication::clipboard();
clipboard->clear();
@ -449,10 +453,6 @@ void TestCli::testClip()
execCmd(clipCmd, {"clip", m_dbFile->fileName(), "/Sample Entry", "0"});
QString errorOutput(m_stderr->readAll());
if (QProcessEnvironment::systemEnvironment().contains("WAYLAND_DISPLAY")) {
QSKIP("Clip test skipped due to QClipboard and Wayland issues");
}
if (errorOutput.contains("Unable to start program")
|| errorOutput.contains("No program defined for clipboard manipulation")) {
QSKIP("Clip test skipped due to missing clipboard tool");