about summary refs log tree commit diff
path: root/pkgs/applications/audio/sfxr-qt
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2022-01-15 19:27:51 +0100
committerFrancesco Gazzetta <fgaz@fgaz.me>2022-03-23 10:59:09 +0100
commitde3c63390d271246c5cc774d9c825fd6f6138b82 (patch)
treee1d58c4c0c66263c02e9243a7c1801bc640fd00d /pkgs/applications/audio/sfxr-qt
parent0cf8a8155bbb8937a93d400a018d5ea279a5b553 (diff)
sfxr-qt: add export test
Diffstat (limited to 'pkgs/applications/audio/sfxr-qt')
-rw-r--r--pkgs/applications/audio/sfxr-qt/default.nix5
-rw-r--r--pkgs/applications/audio/sfxr-qt/test-export-square-wave/default.nix6
-rw-r--r--pkgs/applications/audio/sfxr-qt/test-export-square-wave/input.sfxj29
3 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/applications/audio/sfxr-qt/default.nix b/pkgs/applications/audio/sfxr-qt/default.nix
index 636a67824c53a..f974f9d4d4d8b 100644
--- a/pkgs/applications/audio/sfxr-qt/default.nix
+++ b/pkgs/applications/audio/sfxr-qt/default.nix
@@ -8,6 +8,7 @@
 , qtquickcontrols2
 , SDL
 , python3
+, callPackage
 }:
 
 mkDerivation rec {
@@ -41,6 +42,10 @@ mkDerivation rec {
     SDL
   ];
 
+  passthru.tests = {
+    export-square-wave = callPackage ./test-export-square-wave {};
+  };
+
   meta = with lib; {
     homepage = "https://github.com/agateau/sfxr-qt";
     description = "A sound effect generator, QtQuick port of sfxr";
diff --git a/pkgs/applications/audio/sfxr-qt/test-export-square-wave/default.nix b/pkgs/applications/audio/sfxr-qt/test-export-square-wave/default.nix
new file mode 100644
index 0000000000000..eea0d0743e6a5
--- /dev/null
+++ b/pkgs/applications/audio/sfxr-qt/test-export-square-wave/default.nix
@@ -0,0 +1,6 @@
+{ runCommand, sfxr-qt }:
+
+runCommand "sfxr-qt-test-export-square-wave" ''
+  mkdir $out
+  ${sfxr-qt}/bin/sfxr-qt --export --output $out/output.wav ${./input.sfxj}
+''
diff --git a/pkgs/applications/audio/sfxr-qt/test-export-square-wave/input.sfxj b/pkgs/applications/audio/sfxr-qt/test-export-square-wave/input.sfxj
new file mode 100644
index 0000000000000..5ffd33b93f971
--- /dev/null
+++ b/pkgs/applications/audio/sfxr-qt/test-export-square-wave/input.sfxj
@@ -0,0 +1,29 @@
+{
+    "properties": {
+        "attackTime": 0,
+        "baseFrequency": 1,
+        "changeAmount": 0,
+        "changeSpeed": 0,
+        "decayTime": 1,
+        "deltaSlide": 0,
+        "dutySweep": 0,
+        "hpFilterCutoff": 0,
+        "hpFilterCutoffSweep": 0,
+        "lpFilterCutoff": 1,
+        "lpFilterCutoffSweep": 0,
+        "lpFilterResonance": 0,
+        "minFrequency": 0,
+        "phaserOffset": 0,
+        "phaserSweep": 0,
+        "repeatSpeed": 0,
+        "slide": 0,
+        "squareDuty": 0,
+        "sustainPunch": 0,
+        "sustainTime": 1,
+        "vibratoDepth": 0,
+        "vibratoSpeed": 0,
+        "volume": 1,
+        "waveForm": "Square"
+    },
+    "version": 1
+}