about summary refs log tree commit diff
path: root/pkgs/games/build-support/monogame-patcher/default.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-07-17 04:36:39 +0200
committeraszlig <aszlig@nix.build>2018-07-19 06:35:13 +0200
commit2d3dabe8af2ea4abc51f68891741db360ad11c75 (patch)
tree6c178740ffd8552c2e928939e95f4397364a6e5f /pkgs/games/build-support/monogame-patcher/default.nix
parent3917a5e3c4b7784bf535eafb25e0a47662c0978a (diff)
monogame-patcher: Restructure and add stub tests
Mainly this is so we can prepare for running unit tests, so we get the
latest version of NUnit and run the console test runner.

Currently there is only a dummy test which always succeeds, but it's
there so that we can fill out the boilerplate later.

I also moved the option definitions into a separate file so they don't
clutter up the main file.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games/build-support/monogame-patcher/default.nix')
-rw-r--r--pkgs/games/build-support/monogame-patcher/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/games/build-support/monogame-patcher/default.nix b/pkgs/games/build-support/monogame-patcher/default.nix
index 1a06425e..457d124a 100644
--- a/pkgs/games/build-support/monogame-patcher/default.nix
+++ b/pkgs/games/build-support/monogame-patcher/default.nix
@@ -20,5 +20,26 @@ buildDotnetPackage {
       sha256 = "0wf8mzr16d2ni008m60rrk738v8ypk74llk6g8mlyx7rrlchnxaf";
       outputFiles = [ "lib/net45/*" ];
     })
+
+    (fetchNuGet {
+      baseName = "NUnit";
+      version = "3.10.1";
+      sha256 = "159m1wpb9yy2x77x7nl0647jkpzj5j801a2inhdl7hcjys8xrqxi";
+      outputFiles = [ "lib/net45/*" ];
+    })
+
+    (fetchNuGet {
+      baseName = "NUnit.ConsoleRunner";
+      version = "3.8.0";
+      sha256 = "1gspqzfhvpc8yapni7zcr5h2y025swihv78cw07v048l3myf3pzk";
+      outputFiles = [ "tools/*" ];
+    })
   ];
+
+  doCheck = true;
+  checkPhase = ''
+    nunitLibs="$(pkg-config nunit.framework --variable=Libraries)"
+    MONO_PATH="$(dirname "$nunitLibs")" HOME="$PWD" \
+      nunit3-console bin/Release/monogame-patcher.exe
+  '';
 }