Merge pull request #103261 from veprbl/pr/gean4_tests

geant4.tests.example_B1: init
This commit is contained in:
Dmitry Kalinkin 2020-11-11 08:46:36 -05:00 committed by GitHub
commit 9a3ab73a5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View File

@ -38,6 +38,9 @@
# For enablePython
, boost
, python3
# For tests
, callPackage
}:
let
@ -108,6 +111,8 @@ stdenv.mkDerivation rec {
inherit stdenv fetchurl;
geant_version = version;
};
tests = callPackage ./tests.nix {};
};
# Set the myriad of envars required by Geant4 if we use a nix-shell.

View File

@ -0,0 +1,31 @@
{ stdenv, cmake, geant4 }:
{
example_B1 = stdenv.mkDerivation {
name = "${geant4.name}-test-example_B1";
inherit (geant4) src;
nativeBuildInputs = [ cmake ];
buildInputs = [ geant4 ];
checkInputs = with geant4.data; [
G4EMLOW
G4ENSDFSTATE
G4PARTICLEXS
G4PhotonEvaporation
];
prePatch = ''
cd examples/basic/B1
'';
doCheck = true;
checkPhase = ''
runHook preCheck
./exampleB1 ../run2.mac
runHook postCheck
'';
};
}