summaryrefslogtreecommitdiff
path: root/tests/lib/logger-test-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/logger-test-helper.c')
-rw-r--r--tests/lib/logger-test-helper.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/logger-test-helper.c b/tests/lib/logger-test-helper.c
index ecba2ef..6c5a59b 100644
--- a/tests/lib/logger-test-helper.c
+++ b/tests/lib/logger-test-helper.c
@@ -22,6 +22,8 @@
#include "logger-test-helper.h"
+#include <stdlib.h>
+
#include "util.h"
void
@@ -62,3 +64,23 @@ tpl_test_release_account (TpDBusDaemon *dbus,
g_object_unref (account_service);
g_object_unref (account);
}
+
+void
+tp_tests_copy_dir (const gchar *from_dir, const gchar *to_dir)
+{
+ gchar *command;
+
+ // If destination directory exist erase it
+ command = g_strdup_printf ("rm -rf %s", to_dir);
+ g_assert (system (command) == 0);
+ g_free (command);
+
+ command = g_strdup_printf ("cp -r %s %s", from_dir, to_dir);
+ g_assert (system (command) == 0);
+ g_free (command);
+
+ // In distcheck mode the files and directory are read-only, fix that
+ command = g_strdup_printf ("chmod -R +w %s", to_dir);
+ g_assert (system (command) == 0);
+ g_free (command);
+}