Loading pkgs/development/interpreters/octave/build-octave-package.nix +18 −9 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ stdenv, config, octave, callPackage, texinfo, computeRequiredOctavePackages, writeRequiredOctavePackagesHook, Loading Loading @@ -64,13 +65,6 @@ let writeRequiredOctavePackagesHook ] ++ nativeBuildInputs; passthru' = { updateScript = [ ../../../../maintainers/scripts/update-octave-packages (builtins.unsafeGetAttrPos "pname" octave.pkgs.${attrs.pname}).file ]; } // passthru; # This step is required because when # a = { test = [ "a" "b" ]; }; b = { test = [ "c" "d" ]; }; # (a // b).test = [ "c" "d" ]; Loading @@ -81,9 +75,9 @@ let "nativeBuildInputs" "passthru" ]; in stdenv.mkDerivation ( finalAttrs: { packageName = "${fullLibName}"; # The name of the octave package ends up being Loading Loading @@ -136,7 +130,22 @@ stdenv.mkDerivation ( # together with Octave. dontInstall = true; passthru = passthru'; passthru = { updateScript = [ ../../../../maintainers/scripts/update-octave-packages (builtins.unsafeGetAttrPos "pname" octave.pkgs.${attrs.pname}).file ]; } // passthru // { tests = { testOctaveBuildEnv = (octave.withPackages (os: [ finalAttrs.finalPackage ])).overrideAttrs (old: { name = "${finalAttrs.name}-pkg-install"; }); testOctavePkgTests = callPackage ./run-pkg-test.nix { } finalAttrs.finalPackage; } // passthru.tests or { }; }; inherit meta; } Loading pkgs/development/interpreters/octave/run-pkg-test.nix 0 → 100644 +25 −0 Original line number Diff line number Diff line { octave, runCommand, }: package: runCommand "${package.name}-pkg-test" { nativeBuildInputs = [ (octave.withPackages (os: [ package ])) ]; } '' { octave-cli --eval 'pkg test ${package.pname}' || touch FAILED_ERRCODE; } \ |& tee >( grep --quiet '^Failure Summary:$' && touch FAILED_OUTPUT || : ; cat >/dev/null ) if [[ -f FAILED_ERRCODE ]]; then echo >&2 "octave-cli returned with non-zero exit code." false elif [[ -f FAILED_OUTPUT ]]; then echo >&2 "Test failures detected in output." false else touch $out fi '' Loading
pkgs/development/interpreters/octave/build-octave-package.nix +18 −9 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ stdenv, config, octave, callPackage, texinfo, computeRequiredOctavePackages, writeRequiredOctavePackagesHook, Loading Loading @@ -64,13 +65,6 @@ let writeRequiredOctavePackagesHook ] ++ nativeBuildInputs; passthru' = { updateScript = [ ../../../../maintainers/scripts/update-octave-packages (builtins.unsafeGetAttrPos "pname" octave.pkgs.${attrs.pname}).file ]; } // passthru; # This step is required because when # a = { test = [ "a" "b" ]; }; b = { test = [ "c" "d" ]; }; # (a // b).test = [ "c" "d" ]; Loading @@ -81,9 +75,9 @@ let "nativeBuildInputs" "passthru" ]; in stdenv.mkDerivation ( finalAttrs: { packageName = "${fullLibName}"; # The name of the octave package ends up being Loading Loading @@ -136,7 +130,22 @@ stdenv.mkDerivation ( # together with Octave. dontInstall = true; passthru = passthru'; passthru = { updateScript = [ ../../../../maintainers/scripts/update-octave-packages (builtins.unsafeGetAttrPos "pname" octave.pkgs.${attrs.pname}).file ]; } // passthru // { tests = { testOctaveBuildEnv = (octave.withPackages (os: [ finalAttrs.finalPackage ])).overrideAttrs (old: { name = "${finalAttrs.name}-pkg-install"; }); testOctavePkgTests = callPackage ./run-pkg-test.nix { } finalAttrs.finalPackage; } // passthru.tests or { }; }; inherit meta; } Loading
pkgs/development/interpreters/octave/run-pkg-test.nix 0 → 100644 +25 −0 Original line number Diff line number Diff line { octave, runCommand, }: package: runCommand "${package.name}-pkg-test" { nativeBuildInputs = [ (octave.withPackages (os: [ package ])) ]; } '' { octave-cli --eval 'pkg test ${package.pname}' || touch FAILED_ERRCODE; } \ |& tee >( grep --quiet '^Failure Summary:$' && touch FAILED_OUTPUT || : ; cat >/dev/null ) if [[ -f FAILED_ERRCODE ]]; then echo >&2 "octave-cli returned with non-zero exit code." false elif [[ -f FAILED_OUTPUT ]]; then echo >&2 "Test failures detected in output." false else touch $out fi ''