[tracker] tests: Use random location for tracker-ontology-change test data



commit 700d79e891a6c02ddedc7d7b57de98f12e26f9a4
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Dec 15 12:52:34 2018 +0100

    tests: Use random location for tracker-ontology-change test data
    
    So we don't possibly fail when opening an stale database from previous
    runs.

 tests/libtracker-data/tracker-ontology-change-test.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
---
diff --git a/tests/libtracker-data/tracker-ontology-change-test.c 
b/tests/libtracker-data/tracker-ontology-change-test.c
index 8251f14e3..17bd7f5f6 100644
--- a/tests/libtracker-data/tracker-ontology-change-test.c
+++ b/tests/libtracker-data/tracker-ontology-change-test.c
@@ -181,7 +181,8 @@ test_ontology_change (void)
        test_schemas = g_file_new_for_path (ontology_dir);
        g_free (ontology_dir);
 
-       data_dir = g_build_filename (g_get_current_dir (), "test-cache", NULL);
+       data_dir = g_build_filename (g_get_tmp_dir (), "tracker-ontology-change-test-XXXXXX", NULL);
+       data_dir = g_mkdtemp_full (data_dir, 0700);
        data_location = g_file_new_for_path (data_dir);
        g_free (data_dir);
 
@@ -287,20 +288,8 @@ main (int argc, char **argv)
        gint result;
 
        g_test_init (&argc, &argv, NULL);
-
-       /* add test cases */
-
        g_test_add_func ("/libtracker-data/ontology-change", test_ontology_change);
-
-
-       /* run tests */
-
        result = g_test_run ();
 
-       /* clean up */
-       g_print ("Removing temporary data\n");
-       g_spawn_command_line_sync ("rm -R tracker/", NULL, NULL, NULL, NULL);
-       g_spawn_command_line_sync ("rm -R test-cache/", NULL, NULL, NULL, NULL);
-
        return result;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]