aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-profile-utils.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-05-10 05:35:12 +0800
committerXan Lopez <xan@igalia.com>2012-05-10 05:35:12 +0800
commit6c611eade581a8668e48270b39dc757830ce23ad (patch)
tree85c9114827eea052dbc023ef4d31165a775b07e5 /lib/ephy-profile-utils.c
parentd30b9aed33f491a430a79b36409655d2d45afa8d (diff)
downloadgsoc2013-epiphany-6c611eade581a8668e48270b39dc757830ce23ad.tar
gsoc2013-epiphany-6c611eade581a8668e48270b39dc757830ce23ad.tar.gz
gsoc2013-epiphany-6c611eade581a8668e48270b39dc757830ce23ad.tar.bz2
gsoc2013-epiphany-6c611eade581a8668e48270b39dc757830ce23ad.tar.lz
gsoc2013-epiphany-6c611eade581a8668e48270b39dc757830ce23ad.tar.xz
gsoc2013-epiphany-6c611eade581a8668e48270b39dc757830ce23ad.tar.zst
gsoc2013-epiphany-6c611eade581a8668e48270b39dc757830ce23ad.zip
tests: test that trying to run an invalid migration step fails
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;
}