summary refs log tree commit diff
diff options
context:
space:
mode:
authorLily Foster <lily@lily.flowers>2022-04-18 06:20:02 -0400
committerLily Foster <lily@lily.flowers>2022-04-18 06:20:02 -0400
commit2b7ebac344bc92a6ef43bd543eb104ac08610819 (patch)
tree2ef064d1246cec62e620d028374020fc029b7430
parent591754016f8733a6d860982faddbaeb5650882fd (diff)
downloadnixpkgs-2b7ebac344bc92a6ef43bd543eb104ac08610819.tar
nixpkgs-2b7ebac344bc92a6ef43bd543eb104ac08610819.tar.gz
nixpkgs-2b7ebac344bc92a6ef43bd543eb104ac08610819.tar.bz2
nixpkgs-2b7ebac344bc92a6ef43bd543eb104ac08610819.tar.lz
nixpkgs-2b7ebac344bc92a6ef43bd543eb104ac08610819.tar.xz
nixpkgs-2b7ebac344bc92a6ef43bd543eb104ac08610819.tar.zst
nixpkgs-2b7ebac344bc92a6ef43bd543eb104ac08610819.zip
supercollider: add sc3-plugins test
-rw-r--r--pkgs/development/interpreters/supercollider/default.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/supercollider/default.nix b/pkgs/development/interpreters/supercollider/default.nix
index 59c035dd135..0446e5d540c 100644
--- a/pkgs/development/interpreters/supercollider/default.nix
+++ b/pkgs/development/interpreters/supercollider/default.nix
@@ -2,6 +2,8 @@
 , pkg-config, alsa-lib, libjack2, libsndfile, fftw
 , curl, gcc, libXt, qtbase, qttools, qtwebengine
 , readline, qtwebsockets, useSCEL ? false, emacs
+, supercollider-with-plugins, supercolliderPlugins
+, writeText, runCommand
 }:
 
 mkDerivation rec {
@@ -31,6 +33,26 @@ mkDerivation rec {
     "-DSC_EL=${if useSCEL then "ON" else "OFF"}"
   ];
 
+  passthru.tests = {
+    # test to make sure sclang runs and included plugins are successfully found
+    sclang-sc3-plugins = let
+      supercollider-with-test-plugins = supercollider-with-plugins.override {
+        plugins = with supercolliderPlugins; [ sc3-plugins ];
+      };
+      testsc = writeText "test.sc" ''
+        var err = 0;
+        try {
+        MdaPiano.name.postln;
+        } {
+        err = 1;
+        };
+        err.exit;
+      '';
+    in runCommand "sclang-sc3-plugins-test" {} ''
+      timeout 60s env XDG_CONFIG_HOME="$(mktemp -d)" QT_QPA_PLATFORM=minimal ${supercollider-with-test-plugins}/bin/sclang ${testsc} >$out
+    '';
+  };
+
   meta = with lib; {
     description = "Programming language for real time audio synthesis";
     homepage = "https://supercollider.github.io";