~xavi-garcia-mena/indicator-sound/readd-respawn-upstart

« back to all changes in this revision

Viewing changes to tests/integration/main.cpp

  • Committer: Xavi Garcia Mena
  • Date: 2015-12-23 11:08:16 UTC
  • Revision ID: xavi.garcia.mena@canonical.com-20151223110816-9prwfvfbp437ymh3
Reverted to release 507

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2014 Canonical Ltd.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it
5
 
 * under the terms of the GNU Lesser General Public License version 3,
6
 
 * as published by the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU Lesser General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Authors:
17
 
 *     Pete Woods <pete.woods@canonical.com>
18
 
 */
19
 
 
20
 
//#include <config.h>
21
 
 
22
 
#include <QCoreApplication>
23
 
#include <QTimer>
24
 
#include <gtest/gtest.h>
25
 
 
26
 
#include <libqtdbusmock/DBusMock.h>
27
 
 
28
 
#include "dbus-types.h"
29
 
 
30
 
using namespace QtDBusMock;
31
 
 
32
 
class Runner: public QObject
33
 
{
34
 
    Q_OBJECT
35
 
public Q_SLOTS:
36
 
    void run()
37
 
    {
38
 
        QCoreApplication::exit(RUN_ALL_TESTS());
39
 
    }
40
 
};
41
 
 
42
 
int main(int argc, char **argv)
43
 
{
44
 
    qputenv("LANG", "C.UTF-8");
45
 
    unsetenv("LC_ALL");
46
 
 
47
 
    QCoreApplication application(argc, argv);
48
 
    DBusMock::registerMetaTypes();
49
 
    DBusTypes::registerMetaTypes();
50
 
    ::testing::InitGoogleTest(&argc, argv);
51
 
 
52
 
    Runner runner;
53
 
    QTimer::singleShot(0, &runner, SLOT(run()));
54
 
 
55
 
    return application.exec();
56
 
}
57
 
 
58
 
#include "main.moc"