From a2be3b732d91cf2b0ae7606ed567335a4b611db3 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[EMAIL REDACTED]>
Date: Fri, 20 May 2022 17:29:08 +0100
Subject: [PATCH] test: Set a timeout for unit tests
Suggested by @madebr on #245.
A 30 second timeout happens to be the default in Meson, but otherwise
this is completely arbitrary.
Under normal circumstances, our only test so far takes about 1 second,
so this gives us plenty of headroom for slower architectures or
additional test coverage in future.
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
test/CMakeLists.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 1b6594f..d03cf77 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -50,7 +50,9 @@ foreach(prog ${ALL_TESTS})
)
set_tests_properties(
${prog}
- PROPERTIES ENVIRONMENT "${TESTS_ENVIRONMENT}"
+ PROPERTIES
+ ENVIRONMENT "${TESTS_ENVIRONMENT}"
+ TIMEOUT 30
)
if(INSTALL_TESTS)
set(exe ${prog})