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:
37
test-src/integration/webfuse/test/daemon.cpp
Normal file
37
test-src/integration/webfuse/test/daemon.cpp
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user