[tracker: 1/2] tests: Use tmp dir on tests



commit 3a164cca68226e3f0eea6f9a1d0ae3900b8c1e2a
Author: Andrea Azzarone <andrea azzarone canonical com>
Date:   Fri Jan 18 15:52:07 2019 +0000

    tests: Use tmp dir on tests

 tests/libtracker-data/tracker-backup-test.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/tests/libtracker-data/tracker-backup-test.c b/tests/libtracker-data/tracker-backup-test.c
index 67522e65d..d38fb235b 100644
--- a/tests/libtracker-data/tracker-backup-test.c
+++ b/tests/libtracker-data/tracker-backup-test.c
@@ -267,9 +267,11 @@ main (int argc, char **argv)
        setlocale (LC_COLLATE, "en_US.utf8");
 
        current_dir = g_get_current_dir ();
-       tests_data_dir = g_build_path (G_DIR_SEPARATOR_S, current_dir, "backup-test-data", NULL);
+       tests_data_dir = g_build_filename (current_dir, "backup-test-data-XXXXXX", NULL);
        g_free (current_dir);
 
+       g_mkdtemp (tests_data_dir);
+
        g_test_init (&argc, &argv, NULL);
 
        g_test_add ("/libtracker-data/backup/journal_then_save_and_restore", TestInfo, &tests[0], setup, 
test_backup_and_restore, teardown);


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