@@ -179,9 +179,19 @@ in stdenv.mkDerivation ({
179179 runHook postBuild
180180 '';
181181
182+ # Note: Cabal does *not* copy test executables during the `install` phase.
183+ # Thus we'll just copy them during the check phase.
182184 checkPhase = ''
183185 runHook preCheck
184186 $SETUP_HS test
187+ mkdir -p $out/${name}
188+ cp dist/test/*.log $out/${name}/
189+ if [ -f "dist/build/${componentId.cname}/${componentId.cname}" ]; then
190+ cp dist/build/${componentId.cname}/${componentId.cname} $out/${name}/
191+ fi
192+ if [ -f "dist/build/${componentId.cname}/${componentId.cname}.exe" ]; then
193+ cp dist/build/${componentId.cname}/${componentId.cname} $out/${name}/
194+ fi
185195 runHook postCheck
186196 '';
187197