aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-05-02 11:10:52 -0700
committerCharles Kerr <charles.kerr@canonical.com>2012-05-02 11:10:52 -0700
commitb7a6eedae94cf5276cc549e44af5b4fe7849bda5 (patch)
tree3094cc3300bda1559998bc9b1dcda89d08d711af /tests
parent1ddba0eb336a87dafc522f15be584ba4cbdc97d5 (diff)
parentea22a6005cd8c2c07447bb7303f542d4e00570ad (diff)
downloadayatana-indicator-session-b7a6eedae94cf5276cc549e44af5b4fe7849bda5.tar.gz
ayatana-indicator-session-b7a6eedae94cf5276cc549e44af5b4fe7849bda5.tar.bz2
ayatana-indicator-session-b7a6eedae94cf5276cc549e44af5b4fe7849bda5.zip
merge lp:~charlesk/indicator-session/gtest to add Google Test + libdbustest
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am24
-rw-r--r--tests/test-service.cc56
2 files changed, 80 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..0d30bba
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,24 @@
+
+AM_CPPFLAGS = \
+ $(GTEST_CPPFLAGS) \
+ $(XORG_GTEST_CPPFLAGS) \
+ $(INDICATOR_CFLAGS) \
+ -I${top_srcdir}/src \
+ -Wall -Werror
+AM_CXXFLAGS = $(GTEST_CXXFLAGS)
+
+TESTS = test-service
+check_PROGRAMS = test-service
+test_service_SOURCES = test-service.cc
+test_service_LDADD = $(TEST_SERVICE_LIBS) libgtest.a $(XORG_GTEST_MAIN_LIBS) $(X11_LIBS)
+test_service_CPPFLAGS = \
+ $(TEST_SERVICE_CFLAGS) \
+ $(AM_CPPFLAGS) \
+ -DINDICATOR_SERVICE_PATH="\"$(top_builddir)/src/indicator-session-service\""
+
+check_LIBRARIES = libgtest.a
+nodist_libgtest_a_SOURCES = \
+ $(XORG_GTEST_SOURCE)/src/xorg-gtest-all.cpp \
+ $(GTEST_SOURCE)/src/gtest-all.cc \
+ $(XORG_GTEST_SOURCE)/src/xorg-gtest_main.cpp
+
diff --git a/tests/test-service.cc b/tests/test-service.cc
new file mode 100644
index 0000000..d163db5
--- /dev/null
+++ b/tests/test-service.cc
@@ -0,0 +1,56 @@
+/*
+Copyright 2012 Canonical Ltd.
+
+Authors:
+ Charles Kerr <charles.kerr@canonical.com>
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 3, as published
+by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranties of
+MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <libindicator/indicator-service-test.h>
+
+#include "dbus-shared-names.h"
+
+/***
+****
+***/
+
+/**
+ * Fixture class for testing indicator-session-service with Google Test.
+ */
+class SessionServiceTest: public IndicatorServiceTest
+{
+ public:
+ virtual ~SessionServiceTest() {}
+ SessionServiceTest(): IndicatorServiceTest(INDICATOR_SESSION_DBUS_NAME,
+ INDICATOR_SESSION_DBUS_OBJECT,
+ INDICATOR_SERVICE_PATH) { }
+ public:
+ virtual void SetUp() {
+ wait_seconds(1);
+ IndicatorServiceTest::SetUp();
+ }
+ virtual void TearDown() {
+ IndicatorServiceTest::TearDown();
+ }
+};
+
+
+/**
+ * Basic sanity test to see if we can account for all our menuitems.
+ */
+TEST_F(SessionServiceTest, HelloWorld)
+{
+ ASSERT_TRUE(true);
+}
+