diff options
author | Rico Tzschichholz <ricotz@t-online.de> | 2013-02-18 13:59:13 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@t-online.de> | 2013-02-18 13:59:13 +0100 |
commit | 7869a57ce0f04469e3fdc5e42af1549aa79efd61 (patch) | |
tree | 19d2df6971ceefda15b806ccc2739a2d34b53b91 /test | |
parent | 5b7ea0658717e6fdf3706c9a5ffbd51c5885b5a5 (diff) | |
download | zeitgeist-7869a57ce0f04469e3fdc5e42af1549aa79efd61.tar.gz |
build: Pass make distcheck
Diffstat (limited to 'test')
-rw-r--r-- | test/c/Makefile.am | 7 | ||||
-rw-r--r-- | test/c/test-event.c | 12 | ||||
-rw-r--r-- | test/direct/Makefile.am | 8 | ||||
-rw-r--r-- | test/direct/assertions.vapi | 4 | ||||
-rw-r--r-- | test/direct/datasource-test.vala | 1 | ||||
-rw-r--r-- | test/direct/event-test.vala | 3 | ||||
-rw-r--r-- | test/direct/log-test.vala | 1 | ||||
-rw-r--r-- | test/direct/tests.h | 5 | ||||
-rw-r--r-- | test/direct/tests.vapi | 5 |
9 files changed, 27 insertions, 19 deletions
diff --git a/test/c/Makefile.am b/test/c/Makefile.am index 3c2199b4..ad527475 100644 --- a/test/c/Makefile.am +++ b/test/c/Makefile.am @@ -7,8 +7,7 @@ EXTRA_DIST = \ AM_CFLAGS = \ -Wall \ -g \ - -DZEITGEIST_COMPILATION \ - -DTEST_DIR=\"$(top_srcdir)/tests\" \ + -DTEST_DIR=\"$(abs_srcdir)\" \ $(GIO_UNIX_CFLAGS) \ $(ZEITGEIST_CFLAGS) \ -I $(top_builddir)/libzeitgeist \ @@ -23,7 +22,7 @@ AM_LDFLAGS = \ $(ZEITGEIST_LIBS) \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ test-timerange \ test-timestamp \ test-symbols \ @@ -34,6 +33,8 @@ noinst_PROGRAMS = \ test-mimetypes \ $(NULL) +TESTS = $(check_PROGRAMS) + test_timerange_SOURCES = test-timerange.c test_timestamp_SOURCES = test-timestamp.c test_symbols_SOURCES = test-symbols.c diff --git a/test/c/test-event.c b/test/c/test-event.c index 30cf435d..2537fcd6 100644 --- a/test/c/test-event.c +++ b/test/c/test-event.c @@ -119,9 +119,8 @@ test_create_full (Fixture *fix, gconstpointer data) g_object_unref (ev); } -/* static void -test_actor_from_app_info (Fixture *fix, gconstpointer data) +test_actor_from_info (Fixture *fix, gconstpointer data) { ZeitgeistEvent *ev; GAppInfo *appinfo; @@ -130,11 +129,10 @@ test_actor_from_app_info (Fixture *fix, gconstpointer data) g_assert (G_IS_APP_INFO (appinfo)); ev = zeitgeist_event_new (); - zeitgeist_event_set_actor_from_app_info (ev, appinfo); + zeitgeist_event_set_actor_from_info (ev, appinfo); g_assert_cmpstr ("application://test.desktop", ==, zeitgeist_event_get_actor (ev)); } -*/ static void test_from_variant (Fixture *fix, gconstpointer data) @@ -432,10 +430,8 @@ main (int argc, setup, test_create_empty, teardown); g_test_add ("/Zeitgeist/Event/CreateFull", Fixture, NULL, setup, test_create_full, teardown); - /* - g_test_add ("/Zeitgeist/Event/ActorFromAppInfo", Fixture, NULL, - setup, test_actor_from_app_info, teardown); - */ + g_test_add ("/Zeitgeist/Event/ActorFromInfo", Fixture, NULL, + setup, test_actor_from_info, teardown); g_test_add ("/Zeitgeist/Event/FromVariant", Fixture, NULL, setup, test_from_variant, teardown); g_test_add ("/Zeitgeist/Event/FromVariantWithNewFields", Fixture, NULL, diff --git a/test/direct/Makefile.am b/test/direct/Makefile.am index 367a760a..80279d44 100644 --- a/test/direct/Makefile.am +++ b/test/direct/Makefile.am @@ -2,6 +2,9 @@ NULL = EXTRA_DIST = \ assertions.vapi \ + test.desktop \ + tests.h \ + tests.vapi \ $(NULL) AM_VALAFLAGS = \ @@ -12,6 +15,7 @@ AM_VALAFLAGS = \ --pkg posix \ --pkg gmodule-2.0 \ $(srcdir)/assertions.vapi \ + $(srcdir)/tests.vapi \ $(top_builddir)/libzeitgeist/zeitgeist-datamodel-2.0.vapi \ $(top_builddir)/libzeitgeist/zeitgeist-2.0.vapi \ $(top_builddir)/libzeitgeist/zeitgeist-internal.vapi \ @@ -20,8 +24,12 @@ AM_VALAFLAGS = \ $(NULL) AM_CPPFLAGS = \ + -Wall \ + -g \ + -DTEST_DIR=\"$(abs_srcdir)\" \ $(ZEITGEIST_CFLAGS) \ -include $(CONFIG_HEADER) \ + -I $(srcdir) \ -I $(top_builddir)/libzeitgeist \ -I $(top_builddir)/src \ -w \ diff --git a/test/direct/assertions.vapi b/test/direct/assertions.vapi index 9681739e..58484345 100644 --- a/test/direct/assertions.vapi +++ b/test/direct/assertions.vapi @@ -20,8 +20,4 @@ namespace Assertions { public void assert_cmpuint (uint n1, OperatorType op, uint n2); public void assert_cmphex (uint n1, OperatorType op, uint n2); public void assert_cmpfloat (float n1, OperatorType op, float n2); - - public static string test_dir () { - return GLib.Environment.get_current_dir (); - } } diff --git a/test/direct/datasource-test.vala b/test/direct/datasource-test.vala index d5895dab..c9066f47 100644 --- a/test/direct/datasource-test.vala +++ b/test/direct/datasource-test.vala @@ -23,7 +23,6 @@ using Assertions; int main (string[] argv) { - Environment.set_variable ("XDG_DATA_DIRS", test_dir (), true); Test.init (ref argv); Test.add_func ("/Datasource/CreateEmpty", create_empty_test); diff --git a/test/direct/event-test.vala b/test/direct/event-test.vala index 20f187fa..25a3de13 100644 --- a/test/direct/event-test.vala +++ b/test/direct/event-test.vala @@ -25,7 +25,6 @@ using Assertions; int main (string[] argv) { - Environment.set_variable ("XDG_DATA_DIRS", test_dir (), true); Test.init (ref argv); Test.add_func ("/Event/CreateEmpty", create_empty_test); @@ -86,7 +85,7 @@ void create_full_test () void actor_from_app_info_test () { - var appinfo = new DesktopAppInfo.from_filename (test_dir () + "/test.desktop"); + var appinfo = new DesktopAppInfo.from_filename (Zeitgeist.Tests.DIR + "/test.desktop"); assert (appinfo is AppInfo); var ev = new Event (); diff --git a/test/direct/log-test.vala b/test/direct/log-test.vala index 8f6897bf..473e3b76 100644 --- a/test/direct/log-test.vala +++ b/test/direct/log-test.vala @@ -25,7 +25,6 @@ using Assertions; int main (string[] argv) { - Environment.set_variable ("XDG_DATA_DIRS", test_dir (), true); Test.init (ref argv); Test.add_func ("/Log/InsertGetDelete", insert_get_delete_test); diff --git a/test/direct/tests.h b/test/direct/tests.h new file mode 100644 index 00000000..e3f20cc3 --- /dev/null +++ b/test/direct/tests.h @@ -0,0 +1,5 @@ +#ifdef TEST_DIR +#define DIR TEST_DIR +#else +#define DIR "" +#endif diff --git a/test/direct/tests.vapi b/test/direct/tests.vapi new file mode 100644 index 00000000..97e7a364 --- /dev/null +++ b/test/direct/tests.vapi @@ -0,0 +1,5 @@ +[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "tests.h")] +namespace Zeitgeist.Tests { + public const string DIR; +} + |