use colored unity-test

This commit is contained in:
Rongsong Shen 2025-11-04 16:40:51 +08:00
parent 4dc03b821e
commit da33929aab
2 changed files with 32 additions and 11 deletions

6
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1755615617,
"narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
"lastModified": 1762111121,
"narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "20075955deac2583bb12f07151c2df830ef346b4",
"rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4",
"type": "github"
},
"original": {

View file

@ -5,9 +5,19 @@
cmake,
}:
stdenv.mkDerivation (finalAttrs: {
let
pname = "unity-test";
version = "2.6.1";
meta = {
description = "Unity Unit Testing Framework";
homepage = "https://www.throwtheswitch.org/unity";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.i01011001 ];
};
in
stdenv.mkDerivation (finalAttrs: {
pname = pname;
version = version;
src = fetchFromGitHub {
owner = "ThrowTheSwitch";
@ -20,10 +30,21 @@ stdenv.mkDerivation (finalAttrs: {
makeFlags = [ "UNITY_OUTPUT_COLOR=1" ];
doCheck = true;
meta = {
description = "Unity Unit Testing Framework";
homepage = "https://www.throwtheswitch.org/unity";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.i01011001 ];
};
postInstall = ''
mkdir -p $out/lib/pkgconfig
cat >$out/lib/pkgconfig/unity.pc <<EOF
prefix=$out
exec_prefix=\''${prefix}
libdir=$out/lib
includedir=\''${prefix}/include
Name: ${pname}
Description: ${meta.description}
Version: ${version}
Libs: -L\''${libdir} -lunity
Cflags: -I\''${includedir}
EOF
'';
})