Files
Waybar/test/hyprland/fixtures/IPCTestFixture.hpp
Austin Horstman 4295faa7c4 hyprland/backend: throw runtime_error instead of log
Allows us to disable modules entirely when socket connection isn't
working. This is similar to how sway handles their socket connections
disabling modules. This supports a single waybar config for multiple
IPCs.
2024-07-16 18:40:47 -05:00

26 lines
652 B
C++

#include "modules/hyprland/backend.hpp"
namespace fs = std::filesystem;
namespace hyprland = waybar::modules::hyprland;
class IPCTestFixture : public hyprland::IPC {
public:
IPCTestFixture() : IPC() { IPC::socketFolder_ = ""; }
~IPCTestFixture() { fs::remove_all(tempDir); }
protected:
const char* instanceSig = "instance_sig";
fs::path tempDir = fs::temp_directory_path() / "hypr_test";
private:
};
class IPCMock : public IPCTestFixture {
public:
// Mock getSocket1Reply to return an empty string
static std::string getSocket1Reply(const std::string& rq) { return ""; }
protected:
const char* instanceSig = "instance_sig";
};