]> git.saurik.com Git - apt.git/blame - test/libapt/file-helpers.h
Make directory paths configurable
[apt.git] / test / libapt / file-helpers.h
CommitLineData
f00832cc
DK
1#ifndef APT_TESTS_FILE_HELPERS
2#define APT_TESTS_FILE_HELPERS
3
4#include <string>
5
6#include <gtest/gtest.h>
7
8class FileFd;
9
10#define createTemporaryDirectory(id, dir) \
11 ASSERT_NO_FATAL_FAILURE(helperCreateTemporaryDirectory(id, dir))
12void helperCreateTemporaryDirectory(std::string const &id, std::string &dir);
13#define removeDirectory(dir) \
14 ASSERT_NO_FATAL_FAILURE(helperRemoveDirectory(dir))
15void helperRemoveDirectory(std::string const &dir);
16#define createFile(dir, name) \
17 ASSERT_NO_FATAL_FAILURE(helperCreateFile(dir, name))
18void helperCreateFile(std::string const &dir, std::string const &name);
19#define createDirectory(dir, name) \
20 ASSERT_NO_FATAL_FAILURE(helperCreateDirectory(dir, name))
21void helperCreateDirectory(std::string const &dir, std::string const &name);
22#define createLink(dir, targetname, linkname) \
23 ASSERT_NO_FATAL_FAILURE(helperCreateLink(dir, targetname, linkname))
24void helperCreateLink(std::string const &dir, std::string const &targetname, std::string const &linkname);
25#define createTemporaryFile(id, fd, filename, content) \
26 ASSERT_NO_FATAL_FAILURE(helperCreateTemporaryFile(id, fd, filename, content))
3d8232bf 27void helperCreateTemporaryFile(std::string const &id, FileFd &fd, std::string * const filename, char const * const content);
f00832cc
DK
28
29#endif