Nix: always test in debug mode

This commit is contained in:
Mihai Fufezan 2025-11-22 00:32:57 +02:00
parent 1454845751
commit 31f29957df
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
2 changed files with 6 additions and 10 deletions

View file

@ -7,7 +7,6 @@
gtest,
pixman,
version ? "git",
doCheck ? false,
debug ? false,
# whether to use the mold linker
# disable this for older machines without SSE4_2 and AVX2 support
@ -15,9 +14,8 @@
}:
let
inherit (builtins) foldl';
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.lists) flatten optional;
inherit (lib.strings) cmakeBool optionalString;
inherit (lib.strings) optionalString;
adapters = flatten [
(lib.optional withMold stdenvAdapters.useMoldLinker)
@ -28,16 +26,18 @@ let
in
customStdenv.mkDerivation {
pname = "hyprutils" + optionalString debug "-debug";
inherit version doCheck;
inherit version;
src = ../.;
doCheck = debug;
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = flatten [
(optional doCheck gtest)
(optional debug gtest)
pixman
];
@ -48,10 +48,6 @@ customStdenv.mkDerivation {
cmakeBuildType = if debug then "Debug" else "RelWithDebInfo";
cmakeFlags = mapAttrsToList cmakeBool {
"DISABLE_TESTING" = !doCheck;
};
meta = with lib; {
homepage = "https://github.com/hyprwm/hyprutils";
description = "Small C++ library for utilities used across the Hypr* ecosystem";

View file

@ -18,6 +18,6 @@ in {
inherit version;
};
hyprutils-debug = final.hyprutils.override {debug = true;};
hyprutils-with-tests = final.hyprutils.override {doCheck = true;};
hyprutils-with-tests = final.hyprutils-debug;
};
}