Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
f29c7b10
Commit
f29c7b10
authored
Mar 25, 2022
by
Alexander Lohnau
💬
Browse files
Fix locationsrunner test on BSD CI
parent
4eb900ae
Pipeline
#158097
passed with stage
in 10 minutes and 28 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
runners/locations/autotests/locationsrunnertest.cpp
View file @
f29c7b10
...
...
@@ -20,6 +20,11 @@ private:
private
Q_SLOTS
:
void
initTestCase
();
void
cleanupTestCase
()
{
QFile
::
remove
(
normalHomeFile
);
QFile
::
remove
(
executableHomeFile
);
}
void
shouldNotProduceResult
();
void
shouldNotProduceResult_data
();
void
shouldProduceResult
();
...
...
@@ -30,14 +35,13 @@ private Q_SLOTS:
void
LocationsRunnerTest
::
initTestCase
()
{
initProperties
();
const
QFileInfoList
entries
=
QDir
::
home
().
entryInfoList
(
QDir
::
NoDotAndDotDot
|
QDir
::
Files
|
QDir
::
Hidden
);
for
(
const
QFileInfo
&
entry
:
entries
)
{
if
(
entry
.
isExecutable
())
{
executableHomeFile
=
entry
.
absoluteFilePath
();
}
else
{
normalHomeFile
=
entry
.
absoluteFilePath
();
}
}
normalHomeFile
=
KShell
::
tildeExpand
(
QStringLiteral
(
"~/.krunner_locationsrunner_testfile"
));
executableHomeFile
=
KShell
::
tildeExpand
(
QStringLiteral
(
"~/.krunner_locationsrunner_testexecutablefile"
));
QFile
normalFile
(
normalHomeFile
);
normalFile
.
open
(
QIODevice
::
WriteOnly
);
QFile
executableFile
(
executableHomeFile
);
executableFile
.
open
(
QIODevice
::
WriteOnly
);
executableFile
.
setPermissions
(
executableFile
.
permissions
()
|
QFile
::
ExeOwner
);
QVERIFY
(
!
normalHomeFile
.
isEmpty
());
}
...
...
@@ -54,7 +58,7 @@ void LocationsRunnerTest::shouldProduceResult()
QFETCH
(
QVariant
,
data
);
launchQuery
(
query
);
const
QList
<
Plasma
::
QueryMatch
>
matches
=
manager
->
matches
();
QCOMPARE
(
1
,
matches
.
size
());
QCOMPARE
(
matches
.
size
()
,
1
);
QCOMPARE
(
matches
.
first
().
data
(),
data
);
}
...
...
@@ -92,9 +96,7 @@ void LocationsRunnerTest::shouldProduceResult_data()
QTest
::
newRow
(
"file with $HOME as env variable"
)
<<
KShell
::
tildeCollapse
(
normalHomeFile
).
replace
(
"~"
,
"$HOME"
)
<<
QVariant
(
QUrl
::
fromLocalFile
(
normalHomeFile
));
QTest
::
newRow
(
"file URL"
)
<<
QUrl
::
fromLocalFile
(
normalHomeFile
).
toString
()
<<
QVariant
(
QUrl
::
fromLocalFile
(
normalHomeFile
));
if
(
!
executableHomeFile
.
isEmpty
())
{
QTest
::
newRow
(
"file URL to executable"
)
<<
QUrl
::
fromLocalFile
(
executableHomeFile
).
toString
()
<<
QVariant
(
QUrl
::
fromLocalFile
(
executableHomeFile
));
}
QTest
::
newRow
(
"file URL to executable"
)
<<
QUrl
::
fromLocalFile
(
executableHomeFile
).
toString
()
<<
QVariant
(
QUrl
::
fromLocalFile
(
executableHomeFile
));
if
(
KProtocolInfo
::
isHelperProtocol
(
"vnc"
))
{
QTest
::
newRow
(
"vnc URL"
)
<<
"vnc:foo"
<<
QVariant
(
"vnc:foo"
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment