1
0
mirror of https://github.com/falk-werner/webfuse synced 2026-10-17 09:03:02 +00:00

sepated unit and integration tests

This commit is contained in:
Falk Werner
2023-01-01 13:01:35 +01:00
parent dcb590bd50
commit 0e0bb74872
19 changed files with 34 additions and 19 deletions

View File

@@ -0,0 +1,37 @@
#include "webfuse/test/daemon.hpp"
#include <limits.h>
#include <unistd.h>
#include <libgen.h>
#include <csignal>
namespace
{
std::string get_executable_path()
{
char directory[PATH_MAX] = { '\0' };
readlink("/proc/self/exe", directory, PATH_MAX);
dirname(directory);
return std::string(directory) + "/webfuse";
}
}
namespace webfuse
{
daemon::daemon(std::string const & mountpoint)
: p({get_executable_path(), "-f", mountpoint})
{
}
daemon::~daemon()
{
p.kill(SIGINT);
}
}