diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -4,6 +4,7 @@ if(BUILD_TESTING) find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Test) + find_package(KF5CoreAddons ${KF5_VERSION} REQUIRED) configure_file(testdata.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/testdata.h) ecm_add_test(symlinktest.cpp @@ -16,7 +17,7 @@ ) ecm_add_test(dupetest.cpp TEST_NAME "dupe" - LINK_LIBRARIES Qt5::Test + LINK_LIBRARIES Qt5::Test KF5::CoreAddons ) ecm_add_test(scalabletest.cpp TEST_NAME "scalable" diff --git a/autotests/dupetest.cpp b/autotests/dupetest.cpp --- a/autotests/dupetest.cpp +++ b/autotests/dupetest.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016 Harald Sitter + Copyright 2016-2018 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,7 @@ #include #include +#include #include "testhelpers.h" @@ -32,7 +33,8 @@ QString line; while (proc.canReadLine() || proc.waitForReadyRead()) { line = proc.readLine(); - failListContent(line.simplified().split(QChar(' ')), + // Split through KShell so we don't trip over paths with spaces. + failListContent(KShell::splitArgs(line.simplified()), "The following files are duplicates but not links:\n"); } }