File: syncdbusenvtest.cpp

package info (click to toggle)
kdbusaddons 5.116.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 612 kB
  • sloc: cpp: 1,144; xml: 32; sh: 14; makefile: 7
file content (21 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
    SPDX-FileCopyrightText: 2019 David Edmundson <davidedmundson@kde.org>

    SPDX-License-Identifier: LGPL-2.0-or-later
*/

#include <QCoreApplication>
#include <updatelaunchenvironmentjob.h>

// This test syncs the current environment of the spawned process to systemd/whatever
// akin to dbus-update-activation-environment
// it can then be compared with "systemd-run --user -P env" or watched with dbus-monitor

int main(int argc, char **argv)
{
    QCoreApplication app(argc, argv);
    QEventLoop e;
    auto job = new UpdateLaunchEnvironmentJob(QProcessEnvironment::systemEnvironment());
    QObject::connect(job, &UpdateLaunchEnvironmentJob::finished, &e, &QEventLoop::quit);
    return e.exec();
}