summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/hyprctl.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-08-06 16:28:07 +0200
committerGitHub <noreply@github.com>2025-08-06 16:28:07 +0200
commitec26b753a253bf92ad7451b685b95cbddcb75403 (patch)
tree2b702ff3aab2b5158c2c45b9184f0859681cbf43 /hyprtester/src/tests/main/hyprctl.cpp
parent0c317f25080972c949139460e1e6c8a63daaf05a (diff)
descriptions: fix bad json output (#11350)
--------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Diffstat (limited to 'hyprtester/src/tests/main/hyprctl.cpp')
-rw-r--r--hyprtester/src/tests/main/hyprctl.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/hyprctl.cpp b/hyprtester/src/tests/main/hyprctl.cpp
new file mode 100644
index 00000000..c16b0d97
--- /dev/null
+++ b/hyprtester/src/tests/main/hyprctl.cpp
@@ -0,0 +1,35 @@
+#include "tests.hpp"
+#include "../../shared.hpp"
+#include "../../hyprctlCompat.hpp"
+#include <print>
+#include <thread>
+#include <chrono>
+#include <hyprutils/os/Process.hpp>
+#include <hyprutils/memory/WeakPtr.hpp>
+#include <csignal>
+#include <cerrno>
+#include "../shared.hpp"
+
+static int ret = 0;
+
+using namespace Hyprutils::OS;
+using namespace Hyprutils::Memory;
+
+#define UP CUniquePointer
+#define SP CSharedPointer
+
+static bool test() {
+ NLog::log("{}Testing hyprctl", Colors::GREEN);
+
+ {
+ NLog::log("{}Testing hyprctl descriptions for any json errors", Colors::GREEN);
+ CProcess jqProc("bash", {"-c", "hyprctl descriptions | jq"});
+ jqProc.addEnv("HYPRLAND_INSTANCE_SIGNATURE", HIS);
+ jqProc.runSync();
+ EXPECT(jqProc.exitCode(), 0);
+ }
+
+ return !ret;
+}
+
+REGISTER_TEST_FN(test);