From 2b0a1fc63f5007ce37d03fc849655608c81a853c Mon Sep 17 00:00:00 2001 From: louib Date: Sun, 26 Sep 2021 06:36:54 -0400 Subject: [PATCH] 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. --- tests/CMakeLists.txt | 6 ++---- tests/TestCli.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b2385f1ec..88e907ebc 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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) diff --git a/tests/TestCli.cpp b/tests/TestCli.cpp index 116fe4836..03e6f2439 100644 --- a/tests/TestCli.cpp +++ b/tests/TestCli.cpp @@ -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");