mkcal: use ctestCheckHook

This greatly simplifies the test skipping code.
This commit is contained in:
Sergei Zimmerman
2025-08-19 19:48:27 +03:00
committed by Sergei Zimmerman
parent feab9efa1b
commit a4533f7786
+10 -16
View File
@@ -12,6 +12,7 @@
perl,
pkg-config,
tzdata,
ctestCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -62,6 +63,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeCheckInputs = [
tzdata
ctestCheckHook
];
cmakeFlags = [
@@ -69,25 +71,17 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "INSTALL_TESTS" false)
(lib.cmakeBool "BUILD_DOCUMENTATION" true)
(lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
lib.concatStringsSep ";" [
# Exclude tests
"-E"
(lib.strings.escapeShellArg "(${
lib.concatStringsSep "|" [
# Test expects to be passed a real, already existing database to test migrations. We don't have one
"tst_perf"
# 10/97 tests fail. Half seem related to time (zone) issues w/ local time / Helsinki timezone
# Other half are x-1/x on lists of alarms/events
"tst_storage"
]
})")
]
))
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
disabledTests = [
# Test expects to be passed a real, already existing database to test migrations. We don't have one
"tst_perf"
# 10/97 tests fail. Half seem related to time (zone) issues w/ local time / Helsinki timezone
# Other half are x-1/x on lists of alarms/events
"tst_storage"
];
# Parallelism breaks tests
enableParallelChecking = false;