about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix
new file mode 100644
index 000000000000..83afee6089d4
--- /dev/null
+++ b/nixpkgs/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
+    '';
+  };
+}