Merge pull request #50527 from matthewbauer/ninja-check-phase

Add check phase to ninja setup hook
This commit is contained in:
Matthew Bauer 2018-11-20 16:55:12 -06:00 committed by GitHub
commit d492f53faf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 59 additions and 88 deletions

View File

@ -66,10 +66,6 @@ python3Packages.buildPythonApplication rec {
substituteInPlace cozy/magic/magic.py --replace "ctypes.util.find_library('magic')" "'${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
'';
checkPhase = ''
ninja test
'';
postInstall = ''
ln -s $out/bin/com.github.geigi.cozy $out/bin/cozy
'';

View File

@ -80,7 +80,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
checkInputs = [ gtest ];
checkPhase = "ctest";
# doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
doCheck = false; # fails to pick up supplied gtest, tries to download it instead

View File

@ -32,11 +32,6 @@ stdenv.mkDerivation rec {
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
checkInputs = [ check ];
checkPhase = ''
runHook preCheck
ctest -VV
runHook postCheck
'';
meta = with stdenv.lib; {
description = "Lightweight Tox client";

View File

@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
installCheckPhase = let
pluginPath = "${qtbase.bin}/${qtbase.qtPluginPrefix}";
in lib.optionalString doInstallCheck ''
QT_PLUGIN_PATH=${lib.escapeShellArg pluginPath} CTEST_OUTPUT_ON_FAILURE=1 \
QT_PLUGIN_PATH=${lib.escapeShellArg pluginPath} \
${xvfb_run}/bin/xvfb-run -s '-screen 0 1024x768x24' make test \
ARGS="-E '(reports-chart-test)'" # Test fails, so exclude it for now.
'';

View File

@ -18,8 +18,6 @@ stdenv.mkDerivation rec { pname = "EZminc";
"-DEZMINC_BUILD_MRFSEG=TRUE"
"-DEZMINC_BUILD_DD=TRUE" ];
checkPhase = "ctest --output-on-failure ../tests/"; # but ctest doesn't find the tests ...
enableParallelBuilding = true;
meta = with stdenv.lib; {

View File

@ -19,9 +19,6 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/" "-DEBTKS_DIR=${EBTKS}/lib/" ];
checkPhase = "ctest --output-on-failure";
# don't run the tests as they fail at least due to missing program wrappers in this phase ...
postFixup = ''
for p in $out/bin/*; do
wrapProgram $p --prefix PERL5LIB : $PERL5LIB

View File

@ -21,8 +21,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
checkPhase = "ctest";
postInstall = ''
for file in $out/bin/*; do
wrapProgram $file --set ANTSPATH "$out/bin"

View File

@ -21,8 +21,6 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/" "-DEBTKS_DIR=${EBTKS}/lib/" ];
checkPhase = "ctest --output-on-failure"; # but no tests
postFixup = ''
for p in $out/bin/*; do
wrapProgram $p --prefix PERL5LIB : $PERL5LIB

View File

@ -17,8 +17,6 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/" ];
checkPhase = "ctest --output-on-failure"; # still some weird test failures though
postFixup = ''
for prog in minccomplete minchistory mincpik; do
wrapProgram $out/bin/$prog --prefix PERL5LIB : $PERL5LIB

View File

@ -38,8 +38,6 @@ in stdenv.mkDerivation rec {
doCheck = true;
checkPhase = "ctest";
passthru = {
updateScript = gnome3.updateScript {
packageName = "evolution";

View File

@ -18,7 +18,6 @@ stdenv.mkDerivation rec {
#cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib" "-DBICPL_DIR=${bicpl}/lib" "-DBUILD_TESTING=FALSE" ];
checkPhase = "ctest --output-on-failure";
doCheck = false;
# internal_volume_io.h: No such file or directory

View File

@ -13,9 +13,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
doCheck = !stdenv.isDarwin;
checkPhase = ''
preCheck = ''
export LD_LIBRARY_PATH=$(readlink -f ./src)
CTEST_OUTPUT_ON_FAILURE=1 make test
'';
meta = with stdenv.lib; {

View File

@ -17,7 +17,6 @@ stdenv.mkDerivation rec {
buildInputs = [ libevent openssl ];
doCheck = !stdenv.isDarwin;
checkPhase = "ctest";
meta = with stdenv.lib; {
description = "C client library for Couchbase";

View File

@ -31,7 +31,6 @@ let
doCheck = false; # hangs, tries to access the net?
checkInputs = [ check ];
checkPhase = "ctest";
meta = with stdenv.lib; {
description = "P2P FOSS instant messaging application aimed to replace Skype";

View File

@ -31,10 +31,6 @@ stdenv.mkDerivation rec {
"-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt_cxx.so" "-DPAGMO_WITH_IPOPT=yes"
"-DCMAKE_CXX_FLAGS='-fuse-ld=gold'" ];
checkPhase = ''
ctest
'';
# All but one test pass skip for now (tests also take about 30 min to compile)
doCheck = false;

View File

@ -16,8 +16,6 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/" ];
checkPhase = "ctest --output-on-failure"; # but cmake doesn't run the tests ...
meta = with stdenv.lib; {
homepage = "https://github.com/BIC-MNI/${pname}";
description = "Library for working with MINC files";

View File

@ -19,7 +19,6 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib" "-DBUILD_TESTING=FALSE" ];
checkPhase = "ctest --output-on-failure";
doCheck = false;
# internal_volume_io.h: No such file or directory

View File

@ -13,8 +13,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake python ];
buildInputs = [ itk ];
checkPhase = "ctest";
meta = with stdenv.lib; {
homepage = http://elastix.isi.uu.nl/;
description = "Image registration toolkit based on ITK";

View File

@ -13,7 +13,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [ zlib ];
checkPhase = "ctest";
doCheck = false; # fails 7 out of 293 tests
meta = with stdenv.lib; {

View File

@ -30,10 +30,6 @@ stdenv.mkDerivation rec {
doCheck = ! shared;
checkPhase = "
ctest
";
enableParallelBuilding = true;
meta = with stdenv.lib; {

View File

@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
)
'';
checkPhase = ''
preCheck = ''
# make sure the test starts even if we have less than 4 cores
export OMPI_MCA_rmaps_base_oversubscribe=1
@ -35,9 +35,6 @@ stdenv.mkDerivation rec {
export OMP_NUM_THREADS=1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib
export CTEST_OUTPUT_ON_FAILURE=1
make test
'';
meta = with stdenv.lib; {

View File

@ -15,8 +15,6 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_CXX_FLAGS='-Wno-attributes'" ];
checkPhase = "ctest";
enableParallelBuilding = true;
meta = with stdenv.lib; {

View File

@ -18,10 +18,6 @@ buildPythonPackage rec {
buildInputs = [ nix boost ];
checkPhase = ''
ninja test
'';
meta = with stdenv.lib; {
description = ''
Eval nix code from python.

View File

@ -15,6 +15,11 @@ fixCmakeFiles() {
cmakeConfigurePhase() {
runHook preConfigure
export CTEST_OUTPUT_ON_FAILURE=1
if [ -n "${enableParallelChecking-1}" ]; then
export CTEST_PARALLEL_LEVEL=$NIX_BUILD_CORES
fi
if [ -z "$dontFixCmake" ]; then
fixCmakeFiles .
fi

View File

@ -39,15 +39,3 @@ if [ -z "$dontUseMesonConfigure" -a -z "$configurePhase" ]; then
setOutputFlags=
configurePhase=mesonConfigurePhase
fi
mesonCheckPhase() {
runHook preCheck
meson test --print-errorlogs
runHook postCheck
}
if [ -z "$dontUseMesonCheck" -a -z "$checkPhase" ]; then
checkPhase=mesonCheckPhase
fi

View File

@ -1,9 +1,6 @@
ninjaBuildPhase() {
runHook preBuild
if [[ -z "$ninjaFlags" && ! ( -e build.ninja ) ]]; then
echo "no build.ninja, doing nothing"
else
local buildCores=1
# Parallel building is enabled by default.
@ -11,16 +8,13 @@ ninjaBuildPhase() {
buildCores="$NIX_BUILD_CORES"
fi
# shellcheck disable=SC2086
local flagsArray=( \
-j"$buildCores" -l"$NIX_BUILD_CORES" \
$ninjaFlags "${ninjaFlagsArray[@]}" \
$buildFlags "${buildFlagsArray[@]}")
local flagsArray=(
-j$buildCores -l$NIX_BUILD_CORES
$ninjaFlags "${ninjaFlagsArray[@]}"
)
echoCmd 'build flags' "${flagsArray[@]}"
ninja "${flagsArray[@]}"
unset flagsArray
fi
runHook postBuild
}
@ -32,15 +26,14 @@ fi
ninjaInstallPhase() {
runHook preInstall
installTargets="${installTargets:-install}"
# shellcheck disable=SC2086
local flagsArray=( $installTargets \
$ninjaFlags "${ninjaFlagsArray[@]}")
local flagsArray=(
$ninjaFlags "${ninjaFlagsArray[@]}"
${installTargets:-install}
)
echoCmd 'install flags' "${flagsArray[@]}"
ninja "${flagsArray[@]}"
unset flagsArray
runHook postInstall
}
@ -48,3 +41,38 @@ ninjaInstallPhase() {
if [ -z "$dontUseNinjaInstall" -a -z "$installPhase" ]; then
installPhase=ninjaInstallPhase
fi
ninjaCheckPhase() {
runHook preCheck
if [ -z "${checkTarget:-}" ]; then
if ninja -t query test >/dev/null 2>&1; then
checkTarget=test
fi
fi
if [ -z "${checkTarget:-}" ]; then
echo "no test target found in ninja, doing nothing"
else
local buildCores=1
if [ "${enableParallelChecking-1}" ]; then
buildCores="$NIX_BUILD_CORES"
fi
local flagsArray=(
-j$buildCores -l$NIX_BUILD_CORES
$ninjaFlags "${ninjaFlagsArray[@]}"
$checkTarget
)
echoCmd 'check flags' "${flagsArray[@]}"
ninja "${flagsArray[@]}"
fi
runHook postCheck
}
if [ -z "$dontUseNinjaCheck" -a -z "$checkPhase" ]; then
checkPhase=ninjaCheckPhase
fi