summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntti Keränen <detegr@rbx.email>2023-05-16 09:02:35 +0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-05-21 10:35:57 -0300
commita81af31b38fcc4b6070356990483c9b1b966285d (patch)
treefb63a45fac6f0534fc548645d52c39e50eb01ba5
parentbf17936bdf8e11420f92402bc24eab171a2131ac (diff)
downloadnixpkgs-a81af31b38fcc4b6070356990483c9b1b966285d.tar
nixpkgs-a81af31b38fcc4b6070356990483c9b1b966285d.tar.gz
nixpkgs-a81af31b38fcc4b6070356990483c9b1b966285d.tar.bz2
nixpkgs-a81af31b38fcc4b6070356990483c9b1b966285d.tar.lz
nixpkgs-a81af31b38fcc4b6070356990483c9b1b966285d.tar.xz
nixpkgs-a81af31b38fcc4b6070356990483c9b1b966285d.tar.zst
nixpkgs-a81af31b38fcc4b6070356990483c9b1b966285d.zip
cbqn: run test suite in installCheckPhase
-rw-r--r--pkgs/development/interpreters/bqn/cbqn/default.nix24
-rw-r--r--pkgs/top-level/all-packages.nix6
2 files changed, 24 insertions, 6 deletions
diff --git a/pkgs/development/interpreters/bqn/cbqn/default.nix b/pkgs/development/interpreters/bqn/cbqn/default.nix
index a6e8f4c9feb..f455be74312 100644
--- a/pkgs/development/interpreters/bqn/cbqn/default.nix
+++ b/pkgs/development/interpreters/bqn/cbqn/default.nix
@@ -6,7 +6,7 @@
 , fixDarwinDylibNames
 , genBytecode ? false
 , bqn-path ? null
-, mbqn-source ? null
+, mbqn-source
 , enableReplxx ? false
 , enableSingeli ? stdenv.hostPlatform.avx2Support
 , enableLibcbqn ? ((stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin) && !enableReplxx)
@@ -42,6 +42,7 @@ stdenv.mkDerivation rec {
   ];
 
   dontConfigure = true;
+  doInstallCheck = true;
 
   postPatch = ''
     sed -i '/SHELL =.*/ d' makefile
@@ -100,6 +101,26 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    # main test suite from mlochbaum/BQN
+    $out/bin/BQN ${mbqn-source}/test/this.bqn
+
+    # CBQN tests that do not require compiling with test-only flags
+    $out/bin/BQN test/cmp.bqn
+    $out/bin/BQN test/equal.bqn
+    $out/bin/BQN test/copy.bqn
+    $out/bin/BQN test/bit.bqn
+    $out/bin/BQN test/hash.bqn
+    $out/bin/BQN test/squeezeValid.bqn
+    $out/bin/BQN test/squeezeExact.bqn
+    $out/bin/BQN test/various.bqn
+    $out/bin/BQN test/random.bqn
+
+    runHook postInstallCheck
+  '';
+
   meta = with lib; {
     homepage = "https://github.com/dzaima/CBQN/";
     description = "BQN implementation in C";
@@ -108,4 +129,3 @@ stdenv.mkDerivation rec {
     platforms = platforms.all;
   };
 }
-# TODO: test suite
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c6bf4993f8a..4ae59f66e73 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16761,17 +16761,15 @@ with pkgs;
     mbqn-source = buildPackages.mbqn.src;
 
     phase0 = callPackage ../development/interpreters/bqn/cbqn {
-      inherit (cbqn-bootstrap) stdenv;
+      inherit (cbqn-bootstrap) mbqn-source stdenv;
       genBytecode = false;
       bqn-path = null;
-      mbqn-source = null;
     };
 
     phase0-replxx = callPackage ../development/interpreters/bqn/cbqn {
-      inherit (cbqn-bootstrap) stdenv;
+      inherit (cbqn-bootstrap) mbqn-source stdenv;
       genBytecode = false;
       bqn-path = null;
-      mbqn-source = null;
       enableReplxx = true;
     };