summaryrefslogtreecommitdiff
path: root/tests
diff options
authorNeil Jagdish Patel <neil.patel@canonical.com>2009-12-14 22:23:28 +0000
committerNeil Jagdish Patel <neil.patel@canonical.com>2009-12-14 22:23:28 +0000
commit1f6031395ad7c214c9ecd5ad64a9a011097edfb4 (patch)
treef4bd0cf78fbc19bf67f47259d537013383c40f39 /tests
parent2d8e5318a31238b634725d7baa6c5d8b77192d92 (diff)
[tests] Fix Quicklauncher test. Fix path to test firefox.desktop in two other tests
added: tests/test-const.vapi modified: tests/Makefile.am tests/test-unity.vala (bzr r43.1.8)
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/test-const.vapi25
-rw-r--r--tests/test-unity.vala7
3 files changed, 33 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9b36fb07b..25acabbbd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,8 +1,11 @@
bin_PROGRAMS = test-unity
+TESTDIR = $(top_srcdir)/tests
+
test_unity_CPPFLAGS = \
-I$(top_srcdir)/libunity \
-I$(top_srcdir)/src \
+ -DTESTDIR=\"$(TESTDIR)\" \
$(BASE_CFLAGS) \
$(MAINTAINER_CFLAGS)
@@ -27,6 +30,7 @@ test_unity_VALAFLAGS = \
--pkg clutk-0.3 \
--pkg launcher-0.3 \
--pkg libwnck-1.0 \
+ --pkg test-const \
--pkg unique-1.0 \
--pkg unity \
--pkg unity-static \
diff --git a/tests/test-const.vapi b/tests/test-const.vapi
new file mode 100644
index 000000000..dd1bc17b7
--- /dev/null
+++ b/tests/test-const.vapi
@@ -0,0 +1,25 @@
+/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
+/*
+ * Copyright (C) 2009 Canonical Ltd
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * idst 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 warranty of
+ * MERCHANTABILITY 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/>.
+ *
+ * Authored by Gordon Allott <gord.allott@canonical.com>
+ *
+ */
+
+namespace Unity.Tests {
+ [CCode (cname = "TESTDIR")]
+ public static const string TESTDIR;
+
+}
diff --git a/tests/test-unity.vala b/tests/test-unity.vala
index 1e4a79b17..7c8b139ab 100644
--- a/tests/test-unity.vala
+++ b/tests/test-unity.vala
@@ -21,6 +21,7 @@ using Unity;
public class Main
{
+ public const string firefox_desktop = Unity.Tests.TESTDIR+"/firefox.desktop";
public static int main (string[] args)
{
Gtk.init (ref args);
@@ -58,12 +59,12 @@ public class Main
assert (bg is Clutter.Actor);
});
Test.add_func ("/Unity/Quicklauncher/ApplicationStore", () => {
- var store = new Quicklauncher.Stores.ApplicationStore ("firefox.desktop");
+ var store = new Quicklauncher.Stores.ApplicationStore (firefox_desktop);
assert (store is Quicklauncher.Stores.ApplicationStore);
});
Test.add_func ("/Unity/Quicklauncher/LauncherView", () => {
- var store = new Quicklauncher.Stores.ApplicationStore ("firefox.desktop");
+ var store = new Quicklauncher.Stores.ApplicationStore (firefox_desktop);
var view = new Quicklauncher.LauncherView (store);
assert (view is Quicklauncher.LauncherView);
@@ -76,7 +77,7 @@ public class Main
});
Test.add_func ("/Unity/Quicklauncher/Prism", () => {
- var webapp = new Quicklauncher.Prism ("www.google.com");
+ var webapp = new Quicklauncher.Prism ("http://www.google.com");
assert (webapp is Quicklauncher.Prism);
});