From eeb4ae1c66d292903855fe8e507ef66b82c5b533 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 9 Nov 2020 21:51:27 -0500 Subject: [PATCH] geant4.tests.example_B1: init --- .../libraries/physics/geant4/default.nix | 5 +++ .../libraries/physics/geant4/tests.nix | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/libraries/physics/geant4/tests.nix diff --git a/pkgs/development/libraries/physics/geant4/default.nix b/pkgs/development/libraries/physics/geant4/default.nix index 97822d769dd5..2aa53b213a99 100644 --- a/pkgs/development/libraries/physics/geant4/default.nix +++ b/pkgs/development/libraries/physics/geant4/default.nix @@ -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. diff --git a/pkgs/development/libraries/physics/geant4/tests.nix b/pkgs/development/libraries/physics/geant4/tests.nix new file mode 100644 index 000000000000..83afee6089d4 --- /dev/null +++ b/pkgs/development/libraries/physics/geant4/tests.nix @@ -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 + ''; + }; +}