Merge pull request #75117 from davidak/phoronix-test-suite-tests
phoronix-test-suite: add tests
This commit is contained in:
commit
0dfdfc263d
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, fetchurl, php, which, gnused, makeWrapper, gnumake, gcc }:
|
||||
{ stdenv, fetchurl, php, which, gnused, makeWrapper, gnumake, gcc, callPackage }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "phoronix-test-suite";
|
||||
|
@ -19,6 +19,10 @@ stdenv.mkDerivation rec {
|
|||
--prefix PATH : ${stdenv.lib.makeBinPath [ gnumake gcc ]}
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
simple-execution = callPackage ./tests.nix { };
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Open-Source, Automated Benchmarking";
|
||||
homepage = "https://www.phoronix-test-suite.com/";
|
||||
|
|
20
pkgs/tools/misc/phoronix-test-suite/tests.nix
Normal file
20
pkgs/tools/misc/phoronix-test-suite/tests.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ runCommand, phoronix-test-suite }:
|
||||
|
||||
let
|
||||
inherit (phoronix-test-suite) pname version;
|
||||
in
|
||||
|
||||
runCommand "${pname}-tests" { meta.timeout = 3; }
|
||||
''
|
||||
# automatic initial setup to prevent interactive questions
|
||||
${phoronix-test-suite}/bin/phoronix-test-suite enterprise-setup >/dev/null
|
||||
# get version of installed program and compare with package version
|
||||
if [[ `${phoronix-test-suite}/bin/phoronix-test-suite version` != *"${version}"* ]]; then
|
||||
echo "Error: program version does not match package version"
|
||||
exit 1
|
||||
fi
|
||||
# run dummy command
|
||||
${phoronix-test-suite}/bin/phoronix-test-suite dummy_module.dummy-command >/dev/null
|
||||
# needed for Nix to register the command as successful
|
||||
touch $out
|
||||
''
|
Loading…
Reference in a new issue