Commit a3d52b86 authored by Bhumit Attarde's avatar Bhumit Attarde Committed by Fabian Vogt

added support to skip certain tests if tar protocol isn't supported

parent 1ee510ba
......@@ -9,12 +9,12 @@ qt5_add_dbus_interface(KIOFUSE_TEST_SOURCES org.kde.KIOFuse.VFS.xml kiofuse_inte
qt5_add_dbus_interface(KIOFUSE_TEST_SOURCES org.kde.KIOFuse.Private.xml kiofuseprivate_interface)
add_executable(fileopstest-cache ${KIOFUSE_TEST_SOURCES})
target_link_libraries(fileopstest-cache PRIVATE Qt5::Test Qt5::DBus)
target_link_libraries(fileopstest-cache PRIVATE Qt5::Test Qt5::DBus KF5::KIOCore)
target_compile_definitions(fileopstest-cache PRIVATE -DTEST_CACHE_BASED_IO)
add_test(NAME fileopstest-cache COMMAND dbus-run-session ${CMAKE_BINARY_DIR}/bin/fileopstest-cache)
set_tests_properties(fileopstest-cache PROPERTIES ENVIRONMENT KDE_FORK_SLAVES=1)
add_executable(fileopstest-filejob ${KIOFUSE_TEST_SOURCES})
target_link_libraries(fileopstest-filejob PRIVATE Qt5::Test Qt5::DBus)
target_link_libraries(fileopstest-filejob PRIVATE Qt5::Test Qt5::DBus KF5::KIOCore)
add_test(NAME fileopstest-filejob COMMAND dbus-run-session ${CMAKE_BINARY_DIR}/bin/fileopstest-filejob)
set_tests_properties(fileopstest-filejob PROPERTIES ENVIRONMENT KDE_FORK_SLAVES=1)
......@@ -17,6 +17,9 @@
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusReply>
#include <QDebug>
#include <KProtocolInfo>
#include "kiofuse_interface.h"
#include "kiofuseprivate_interface.h"
......@@ -583,6 +586,9 @@ void FileOpsTest::testDeletionOps()
void FileOpsTest::testArchiveOps()
{
if (!KProtocolInfo::isKnownProtocol(QStringLiteral("tar")))
QSKIP("Test requires tar protocol to be supported. See README for packages required.");
QString outerpath = QFINDTESTDATA(QStringLiteral("data/outerarchive.tar.gz"));
// Mount a file inside the archive
......@@ -880,6 +886,9 @@ void FileOpsTest::testSymlinkRewrite()
QCOMPARE(readlink(localDir.filePath(QStringLiteral("symlink"))),
localDir.filePath(QStringLiteral("somedir/../somefile")));
if (!KProtocolInfo::isKnownProtocol(QStringLiteral("tar")))
QSKIP("Test requires tar protocol to be supported. See README for packages required.");
// Mount something with a different origin
QString outerpath = QFINDTESTDATA(QStringLiteral("data/outerarchive.tar.gz"));
reply = m_kiofuse_iface.mountUrl(QStringLiteral("tar://%1/outerarchive/").arg(outerpath)).value();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment