diff --git a/pkgs/development/libraries/qrencode/default.nix b/pkgs/development/libraries/qrencode/default.nix
index 7e6b20599af..1cbdf1ffdf8 100644
--- a/pkgs/development/libraries/qrencode/default.nix
+++ b/pkgs/development/libraries/qrencode/default.nix
@@ -14,8 +14,22 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ SDL2 libpng ];
 
+  configureFlags = [
+    "--with-tests"
+  ];
+
   doCheck = true;
 
+  checkPhase = ''
+    runHook preCheck
+
+    pushd tests
+    ./test_basic.sh
+    popd
+
+    runHook postCheck
+  '';
+
   meta = with stdenv.lib; {
     homepage = https://fukuchi.org/works/qrencode/;
     description = "C library for encoding data in a QR Code symbol";