aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-profile-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ephy-profile-utils.c')
-rw-r--r--lib/ephy-profile-utils.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/ephy-profile-utils.c b/lib/ephy-profile-utils.c
index 05367be8e..3fd3c525c 100644
--- a/lib/ephy-profile-utils.c
+++ b/lib/ephy-profile-utils.c
@@ -188,21 +188,43 @@ _ephy_profile_utils_query_form_auth_data (const char *uri,
}
gboolean
-ephy_profile_utils_do_migration ()
+ephy_profile_utils_do_migration (int test_to_run, gboolean debug)
{
gboolean ret;
GError *error = NULL;
- char *argv[1] = { "ephy-profile-migrator" };
+ char *index = NULL, *path = NULL;
+ int status;
+ char *argv[3] = { "ephy_profile_migrator" };
char *envp[1] = { "EPHY_LOG_MODULES=ephy-profile" };
+ if (test_to_run != -1) {
+ index = g_strdup_printf ("%d", test_to_run);
+
+ argv[1] = "-d";
+ argv[2] = index;
+ argv[3] = NULL;
+ } else {
+ argv[1] = NULL;
+ }
+
+ if (debug) {
+ path = g_strdup_printf ("%s/lib/ephy-profile-migrator", TOP_BUILD_DIR);
+ argv[0] = path;
+ }
+
ret = g_spawn_sync (NULL, argv, envp, G_SPAWN_SEARCH_PATH,
NULL, NULL, NULL, NULL,
- NULL, &error);
+ &status, &error);
+ g_free (path);
+ g_free (index);
if (error) {
LOG ("Failed to run migrator: %s", error->message);
g_error_free (error);
}
+ if (status != 0)
+ ret = FALSE;
+
return ret;
}