on iko/ghcjs-patch-master help sign in
Update comp-builder to run tests directly (#168)
83e4c75Rupert Horlick
builder/comp-builder.nix+6−3
@@ -104,6 +104,9 @@ let
104 && (haskellLib.isLibrary componentId)
104 && (haskellLib.isLibrary componentId)
105 && stdenv.hostPlatform == stdenv.buildPlatform;
105 && stdenv.hostPlatform == stdenv.buildPlatform;
106
106
107+ testExecutable = "dist/build/${componentId.cname}/${componentId.cname}"
108+ + lib.optionalString stdenv.hostPlatform.isWindows ".exe";
109+
107in stdenv.lib.fix (drv:
110in stdenv.lib.fix (drv:
108
111
109stdenv.mkDerivation ({
112stdenv.mkDerivation ({
@@ -179,9 +182,9 @@ stdenv.mkDerivation ({
179
182
180 checkPhase = ''
183 checkPhase = ''
181 runHook preCheck
184 runHook preCheck
185+
182− $SETUP_HS test ${lib.concatStringsSep " " component.setupTestFlags}
186+ ${component.testWrapper} ${testExecutable} ${lib.concatStringsSep " " component.testFlags}
183− mkdir -p $out/${name}
187+
184− cp dist/test/*.log $out/${name}/
185 runHook postCheck
188 runHook postCheck
186 '';
189 '';
187
190
modules/plan.nix+7−2
@@ -43,9 +43,9 @@ let
43 type = listOfFilteringNulls str;
43 type = listOfFilteringNulls str;
44 default = (def.setupBuildFlags or []);
44 default = (def.setupBuildFlags or []);
45 };
45 };
46− setupTestFlags = mkOption {
46+ testFlags = mkOption {
47 type = listOfFilteringNulls str;
47 type = listOfFilteringNulls str;
48− default = (def.setupTestFlags or []);
48+ default = (def.testFlags or []);
49 };
49 };
50 setupInstallFlags = mkOption {
50 setupInstallFlags = mkOption {
51 type = listOfFilteringNulls str;
51 type = listOfFilteringNulls str;
@@ -123,6 +123,11 @@ let
123 type = nullOr string;
123 type = nullOr string;
124 default = (def.preCheck or null);
124 default = (def.preCheck or null);
125 };
125 };
126+ # Wrapper for test executable run in checkPhase
127+ testWrapper = mkOption {
128+ type = string;
129+ default = (def.testWrapper or "");
130+ };
126 postCheck = mkOption {
131 postCheck = mkOption {
127 type = nullOr string;
132 type = nullOr string;
128 default = (def.postCheck or null);
133 default = (def.postCheck or null);