summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/exec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'hyprtester/src/tests/main/exec.cpp')
-rw-r--r--hyprtester/src/tests/main/exec.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/hyprtester/src/tests/main/exec.cpp b/hyprtester/src/tests/main/exec.cpp
index 099f2cbc..ff19edfe 100644
--- a/hyprtester/src/tests/main/exec.cpp
+++ b/hyprtester/src/tests/main/exec.cpp
@@ -8,8 +8,6 @@
#include <hyprutils/memory/WeakPtr.hpp>
#include "../shared.hpp"
-static int ret = 0;
-
using namespace Hyprutils::OS;
using namespace Hyprutils::Memory;
@@ -18,9 +16,7 @@ using namespace Hyprutils::Memory;
const static auto SLEEP_DURATIONS = std::array{1, 10};
-static bool test() {
- NLog::log("{}Testing process spawning", Colors::GREEN);
-
+TEST_CASE(processSpawning) {
for (const auto duration : SLEEP_DURATIONS) {
// Note: POSIX sleep does not support fractional seconds, so
// can't sleep for less than 1 second.
@@ -45,17 +41,9 @@ static bool test() {
// Ensure that sleep did not become a zombie
EXPECT(Tests::processAlive(sleepPid), false);
- // kill all
- NLog::log("{}Killing all windows", Colors::YELLOW);
- Tests::killAllWindows();
-
- NLog::log("{}Expecting 0 windows", Colors::YELLOW);
- EXPECT(Tests::windowCount(), 0);
-
- return !ret;
+ // Test succeeded
+ return;
}
- return false;
+ FAIL_TEST_SILENT();
}
-
-REGISTER_TEST_FN(test)