┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorSebastian Englbrecht <[email protected]>2026-05-23 15:30:30 +0200
committerMéven Car <[email protected]>2026-05-28 08:12:53 +0000
commit1330df1053a9ee9927dc27e1f333a67965dbf02e (patch)
treef78bee964ddac22c7d9df707ad628121db93765b /src/main.cpp
parent74a63f5fa93285f59aed6e47656fc2d18f4d4567 (diff)
tests: create smoke test for dolphin
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1ef608193..3c89f98a9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -37,6 +37,7 @@
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QSessionManager>
+#include <QTimer>
#if HAVE_X11
#include <private/qtx11extras_p.h>
@@ -142,6 +143,12 @@ int main(int argc, char **argv)
i18nc("@info:shell", "Set up Dolphin for administrative tasks.")));
parser.addOption(
QCommandLineOption(QStringList() << QStringLiteral("daemon"), i18nc("@info:shell", "Start Dolphin Daemon (only required for DBus Interface).")));
+#ifdef BUILD_TESTING
+ {
+ QCommandLineOption selfTestOption(QStringLiteral("self-test"));
+ parser.addOption(selfTestOption);
+ }
+#endif
parser.addPositionalArgument(QStringLiteral("+[Url]"), i18nc("@info:shell", "Document to open"));
parser.process(app);
@@ -275,5 +282,11 @@ int main(int argc, char **argv)
Q_UNUSED(feedbackProvider)
#endif
+#ifdef BUILD_TESTING
+ if (parser.isSet(QStringLiteral("self-test"))) {
+ QTimer::singleShot(std::chrono::milliseconds(500), &app, &QCoreApplication::quit);
+ }
+#endif
+
return app.exec(); // krazy:exclude=crash;
}