Skip to content

Commit

Permalink
Run valgrind in more environments
Browse files Browse the repository at this point in the history
  • Loading branch information
jbboehr committed Apr 5, 2024
1 parent 4f9ebc6 commit 6ff37cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
env:
NO_INTERACTION: 1
REPORT_EXIT_STATUS: 1
USE_ZEND_ALLOC: 0

- run: cat tests/*.log
if: failure()
Expand Down
18 changes: 13 additions & 5 deletions nix/derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
libcap,
libpfm,
pkg-config,
valgrind,
autoreconfHook,
buildPecl,
src,
checkSupport ? false,
WerrorSupport ? false,
WerrorSupport ? checkSupport,
valgrindSupport ? true,
}:
buildPecl rec {
pname = "perfidious";
Expand All @@ -19,7 +21,9 @@ buildPecl rec {
inherit src;

buildInputs = [libcap libpfm];
nativeBuildInputs = [php.unwrapped.dev pkg-config];
nativeBuildInputs =
[php.unwrapped.dev pkg-config]
++ lib.optional valgrindSupport valgrind;

passthru = {
inherit php libpfm stdenv;
Expand All @@ -34,9 +38,13 @@ buildPecl rec {
outputs = ["out" "dev"];

doCheck = checkSupport;
checkPhase =
''
NO_INTERACTON=yes REPORT_EXIT_STATUS=yes make test
''
+ (lib.optionalString valgrindSupport ''
USE_ZEND_ALLOC=0 NO_INTERACTON=yes REPORT_EXIT_STATUS=yes make test TEST_PHP_ARGS=-m
'');

#TEST_PHP_DETAILED = 1;
NO_INTERACTION = 1;
REPORT_EXIT_STATUS = 1;
TEST_PHP_ARGS = "-c ${php.phpIni}";
}

0 comments on commit 6ff37cb

Please sign in to comment.