File tree Expand file tree Collapse file tree 2 files changed +43
-9
lines changed
pkgs/development/interpreters/octave Expand file tree Collapse file tree 2 files changed +43
-9
lines changed Original file line number Diff line number Diff line change 99 stdenv ,
1010 config ,
1111 octave ,
12+ callPackage ,
1213 texinfo ,
1314 computeRequiredOctavePackages ,
1415 writeRequiredOctavePackagesHook ,
6465 writeRequiredOctavePackagesHook
6566 ] ++ nativeBuildInputs ;
6667
67- passthru' = {
68- updateScript = [
69- ../../../../maintainers/scripts/update-octave-packages
70- ( builtins . unsafeGetAttrPos "pname" octave . pkgs . ${ attrs . pname } ) . file
71- ] ;
72- } // passthru ;
73-
7468 # This step is required because when
7569 # a = { test = [ "a" "b" ]; }; b = { test = [ "c" "d" ]; };
7670 # (a // b).test = [ "c" "d" ];
8175 "nativeBuildInputs"
8276 "passthru"
8377 ] ;
84-
8578in
8679stdenv . mkDerivation (
80+ finalAttrs :
8781 {
8882 packageName = "${ fullLibName } " ;
8983 # The name of the octave package ends up being
@@ -136,7 +130,22 @@ stdenv.mkDerivation (
136130 # together with Octave.
137131 dontInstall = true ;
138132
139- passthru = passthru' ;
133+ passthru =
134+ {
135+ updateScript = [
136+ ../../../../maintainers/scripts/update-octave-packages
137+ ( builtins . unsafeGetAttrPos "pname" octave . pkgs . ${ attrs . pname } ) . file
138+ ] ;
139+ }
140+ // passthru
141+ // {
142+ tests = {
143+ testOctaveBuildEnv = ( octave . withPackages ( os : [ finalAttrs . finalPackage ] ) ) . overrideAttrs ( old : {
144+ name = "${ finalAttrs . name } -pkg-install" ;
145+ } ) ;
146+ testOctavePkgTests = callPackage ./run-pkg-test.nix { } finalAttrs . finalPackage ;
147+ } // passthru . tests or { } ;
148+ } ;
140149
141150 inherit meta ;
142151 }
Original file line number Diff line number Diff line change 1+ {
2+ octave ,
3+ runCommand ,
4+ } :
5+ package :
6+
7+ runCommand "${ package . name } -pkg-test"
8+ {
9+ nativeBuildInputs = [
10+ ( octave . withPackages ( os : [ package ] ) )
11+ ] ;
12+ }
13+ ''
14+ { octave-cli --eval 'pkg test ${ package . pname } ' || touch FAILED_ERRCODE; } \
15+ |& tee >( grep --quiet '^Failure Summary:$' && touch FAILED_OUTPUT || : ; cat >/dev/null )
16+ if [[ -f FAILED_ERRCODE ]]; then
17+ echo >&2 "octave-cli returned with non-zero exit code."
18+ false
19+ elif [[ -f FAILED_OUTPUT ]]; then
20+ echo >&2 "Test failures detected in output."
21+ false
22+ else
23+ touch $out
24+ fi
25+ ''
You can’t perform that action at this time.
0 commit comments