1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-09-29 06:50:43 +00:00
falk-werner_webfuse/test-src/integration/webfuse/test/fixture.hpp
2023-01-01 13:01:35 +01:00

47 lines
887 B
C++

#ifndef WEBFUSE_FIXTURE_HPP
#define WEBFUSE_FIXTURE_HPP
#include "webfuse/filesystem/filesystem_i.hpp"
#include "webfuse/webfuse.hpp"
#include "webfuse/provider.hpp"
#include "webfuse/test/tempdir.hpp"
#include "webfuse/test/daemon.hpp"
#include <string>
#include <memory>
#include <thread>
#include <atomic>
namespace webfuse
{
class fixture
{
fixture(fixture const &) = delete;
fixture& operator=(fixture const &) = delete;
fixture(fixture const &&) = delete;
fixture& operator=(fixture &&) = delete;
public:
explicit fixture(filesystem_i & fs);
~fixture();
std::string const & get_path() const;
void reconnect();
private:
void provider_run();
std::atomic<bool> shutdown_requested;
std::atomic<bool> provider_running;
provider fs_provider;
tempdir working_dir;
daemon app;
std::thread provider_thread;
};
}
#endif