aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ephy-migration-test.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-05-10 00:10:33 +0800
committerXan Lopez <xan@igalia.com>2012-05-10 00:10:33 +0800
commit3a759d2daf17ee1152bc3cfc6b1e7eb198177e76 (patch)
treed39bd9421122fdf0d703c98dde37e41bb67f0b73 /tests/ephy-migration-test.c
parentcc55649fb5923e1ba1c89c3c8aa25b1cb9401cda (diff)
downloadgsoc2013-epiphany-3a759d2daf17ee1152bc3cfc6b1e7eb198177e76.tar
gsoc2013-epiphany-3a759d2daf17ee1152bc3cfc6b1e7eb198177e76.tar.gz
gsoc2013-epiphany-3a759d2daf17ee1152bc3cfc6b1e7eb198177e76.tar.bz2
gsoc2013-epiphany-3a759d2daf17ee1152bc3cfc6b1e7eb198177e76.tar.lz
gsoc2013-epiphany-3a759d2daf17ee1152bc3cfc6b1e7eb198177e76.tar.xz
gsoc2013-epiphany-3a759d2daf17ee1152bc3cfc6b1e7eb198177e76.tar.zst
gsoc2013-epiphany-3a759d2daf17ee1152bc3cfc6b1e7eb198177e76.zip
tests: start tests for the migration code
Trivial first test, we just check the migration binary runs and does not catastrophically.
Diffstat (limited to 'tests/ephy-migration-test.c')
-rw-r--r--tests/ephy-migration-test.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/ephy-migration-test.c b/tests/ephy-migration-test.c
new file mode 100644
index 000000000..8acfdb461
--- /dev/null
+++ b/tests/ephy-migration-test.c
@@ -0,0 +1,62 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * ephy-migration-test.c
+ *
+ * Copyright © 2012 - Igalia S.L.
+ *
+ * Epiphany is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Epiphany 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 Epiphany; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+
+#include "ephy-debug.h"
+#include "ephy-embed-prefs.h"
+#include "ephy-embed-private.h"
+#include "ephy-file-helpers.h"
+#include "ephy-private.h"
+#include "ephy-profile-utils.h"
+
+#include <gtk/gtk.h>
+
+static void
+test_do_migration_simple (void)
+{
+ gboolean ret;
+
+ ret = ephy_profile_utils_do_migration ();
+ g_assert (ret);
+}
+
+int
+main (int argc, char *argv[])
+{
+ gtk_test_init (&argc, &argv);
+
+ ephy_debug_init ();
+ ephy_embed_prefs_init ();
+
+ if (!ephy_file_helpers_init (NULL,
+ EPHY_FILE_HELPERS_PRIVATE_PROFILE | EPHY_FILE_HELPERS_ENSURE_EXISTS,
+ NULL)) {
+ g_debug ("Something wrong happened with ephy_file_helpers_init()");
+ return -1;
+ }
+
+ g_test_add_func ("/lib/ephy-profile-utils/do_migration_simple",
+ test_do_migration_simple);
+
+ return g_test_run ();
+}