summaryrefslogtreecommitdiff
path: root/test/libapt/file-helpers.h
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-07 15:41:54 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-07 15:41:54 +0200
commitff94be47f5dbdcf99cea23fad8c9b992a8e5a67e (patch)
treedd57b80bf6ecd853fb3c6d5eab041630ecd1e75e /test/libapt/file-helpers.h
parente39698a485e332742b935292dc4329abf19cbb53 (diff)
parent98c934f2723d63d00908803ad47ab1359081ec2d (diff)
Merge branch 'debian/sid' into bugfix/update-progress-reporting
Diffstat (limited to 'test/libapt/file-helpers.h')
-rw-r--r--test/libapt/file-helpers.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/libapt/file-helpers.h b/test/libapt/file-helpers.h
new file mode 100644
index 000000000..e8472d503
--- /dev/null
+++ b/test/libapt/file-helpers.h
@@ -0,0 +1,29 @@
+#ifndef APT_TESTS_FILE_HELPERS
+#define APT_TESTS_FILE_HELPERS
+
+#include <string>
+
+#include <gtest/gtest.h>
+
+class FileFd;
+
+#define createTemporaryDirectory(id, dir) \
+ ASSERT_NO_FATAL_FAILURE(helperCreateTemporaryDirectory(id, dir))
+void helperCreateTemporaryDirectory(std::string const &id, std::string &dir);
+#define removeDirectory(dir) \
+ ASSERT_NO_FATAL_FAILURE(helperRemoveDirectory(dir))
+void helperRemoveDirectory(std::string const &dir);
+#define createFile(dir, name) \
+ ASSERT_NO_FATAL_FAILURE(helperCreateFile(dir, name))
+void helperCreateFile(std::string const &dir, std::string const &name);
+#define createDirectory(dir, name) \
+ ASSERT_NO_FATAL_FAILURE(helperCreateDirectory(dir, name))
+void helperCreateDirectory(std::string const &dir, std::string const &name);
+#define createLink(dir, targetname, linkname) \
+ ASSERT_NO_FATAL_FAILURE(helperCreateLink(dir, targetname, linkname))
+void helperCreateLink(std::string const &dir, std::string const &targetname, std::string const &linkname);
+#define createTemporaryFile(id, fd, filename, content) \
+ ASSERT_NO_FATAL_FAILURE(helperCreateTemporaryFile(id, fd, filename, content))
+void helperCreateTemporaryFile(std::string const &id, FileFd &fd, char * * const filename, char const * const content);
+
+#endif