From 936f70de166eb2c6d0a32d53c31bc329477dcea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 18 Aug 2022 14:21:04 +0200 Subject: [PATCH] cvise: add tests back --- pkgs/development/tools/misc/cvise/default.nix | 60 +++++++++++++++---- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/pkgs/development/tools/misc/cvise/default.nix b/pkgs/development/tools/misc/cvise/default.nix index 6db4a89becbd..47dde66e79cb 100644 --- a/pkgs/development/tools/misc/cvise/default.nix +++ b/pkgs/development/tools/misc/cvise/default.nix @@ -1,6 +1,16 @@ -{ lib, buildPythonApplication, fetchFromGitHub, bash, cmake, flex -, libclang, llvm, unifdef -, chardet, pebble, psutil +{ lib +, buildPythonApplication +, fetchFromGitHub +, bash +, cmake +, flex +, libclang +, llvm +, unifdef +, chardet +, pebble +, psutil +, pytestCheckHook }: buildPythonApplication rec { @@ -19,18 +29,48 @@ buildPythonApplication rec { ./unifdef.patch ]; - nativeBuildInputs = [ cmake flex llvm.dev ]; - buildInputs = [ bash libclang llvm llvm.dev unifdef ]; - propagatedBuildInputs = [ chardet pebble psutil ]; - - # 'cvise --command=...' generates a script with hardcoded shebang. postPatch = '' + # 'cvise --command=...' generates a script with hardcoded shebang. substituteInPlace cvise.py \ --replace "#!/bin/bash" "#!${bash}/bin/bash" + + substituteInPlace setup.cfg \ + --replace "--flake8" "" ''; - # pytest-flake8 is broken in nixpkgs: https://github.com/tholo/pytest-flake8/issues/87 - doCheck = false; + nativeBuildInputs = [ + cmake + flex + llvm.dev + ]; + + buildInputs = [ + libclang + llvm + llvm.dev + unifdef + ]; + + propagatedBuildInputs = [ + chardet + pebble + psutil + ]; + + checkInputs = [ + pytestCheckHook + unifdef + ]; + + preCheck = '' + patchShebangs cvise.py + ''; + + disabledTests = [ + # Needs gcc, fails when run noninteractively (without tty). + "test_simple_reduction" + ]; + dontUsePipInstall = true; dontUseSetuptoolsBuild = true; dontUseSetuptoolsCheck = true;