~unity8-desktop-session-team/indicator-session/indicator-session-using-upstart

« back to all changes in this revision

Viewing changes to tests/test-service.cc

  • Committer: Charles Kerr
  • Date: 2012-04-26 19:34:38 UTC
  • mto: (254.1.5 gtest)
  • mto: This revision was merged to the branch mainline in revision 255.
  • Revision ID: charles.kerr@canonical.com-20120426193438-3emnu0c1wuvjzuo8
add scaffolding for indicator-session-service Google Testing with libdbustest

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2012 Canonical Ltd.
 
3
 
 
4
Authors:
 
5
    Charles Kerr <charles.kerr@canonical.com>
 
6
 
 
7
This program is free software: you can redistribute it and/or modify it 
 
8
under the terms of the GNU General Public License version 3, as published 
 
9
by the Free Software Foundation.
 
10
 
 
11
This program is distributed in the hope that it will be useful, but 
 
12
WITHOUT ANY WARRANTY; without even the implied warranties of 
 
13
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
 
14
PURPOSE.  See the GNU General Public License for more details.
 
15
 
 
16
You should have received a copy of the GNU General Public License along 
 
17
with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
*/
 
19
 
 
20
#include <libindicator/indicator-service-test.h>
 
21
 
 
22
#include "dbus-shared-names.h"
 
23
 
 
24
/***
 
25
****
 
26
***/
 
27
 
 
28
static const char * the_executable = NULL;
 
29
 
 
30
/**
 
31
 * Fixture class for testing indicator-session-service with Google Test.
 
32
 */
 
33
class SessionServiceTest: public IndicatorServiceTest
 
34
{
 
35
  public:
 
36
    virtual ~SessionServiceTest() {}
 
37
    SessionServiceTest(): IndicatorServiceTest(INDICATOR_SESSION_DBUS_NAME,
 
38
                                               INDICATOR_SESSION_DBUS_OBJECT,
 
39
                                               the_executable) { }
 
40
  public:
 
41
    virtual void SetUp() {
 
42
      wait_seconds(1);
 
43
      IndicatorServiceTest::SetUp();
 
44
    }
 
45
    virtual void TearDown() {
 
46
      IndicatorServiceTest::TearDown();
 
47
    }
 
48
};
 
49
 
 
50
 
 
51
/**
 
52
 * Basic sanity test to see if we can account for all our menuitems.
 
53
 */
 
54
TEST_F(SessionServiceTest, HelloWorld)
 
55
{
 
56
  ASSERT_TRUE(true);
 
57
}
 
58
 
 
59
 
 
60
int
 
61
main (int argc, char *argv[])
 
62
{
 
63
  if (argc < 2) {
 
64
    fprintf (stderr, "Usage: appname /path/to/indicator-session-service");
 
65
    return -1;
 
66
  }
 
67
  the_executable = argv[1];
 
68
  fprintf (stdout, "executable is '%s'\n", the_executable);
 
69
  ::testing::InitGoogleTest(&argc, argv);
 
70
  return RUN_ALL_TESTS();
 
71
}