about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBerk D. Demir <bdd@mindcast.org>2022-05-01 23:15:08 +0000
committerBerk D. Demir <bdd@mindcast.org>2022-06-01 01:04:23 +0000
commitaee4df7eeb9c250f5f03cbb46fb408d56cadf3a2 (patch)
tree3e72ddcfe4937eb1a6df551825af32ef75b5d9e5
parent032f261fae00459598a7aac3c4893c668c9d41cc (diff)
go-mtpfs: Disable tests req'ing USB attached devs
These test are written in a way that they don't skip themselves if they
cannot find an Android device attached over USB to the running host.

Bug fixed by #173702 runs the previously skipped tests for this
package.
-rw-r--r--pkgs/tools/filesystems/go-mtpfs/default.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/tools/filesystems/go-mtpfs/default.nix b/pkgs/tools/filesystems/go-mtpfs/default.nix
index 4bb2a3c24d5fe..260e6891f956e 100644
--- a/pkgs/tools/filesystems/go-mtpfs/default.nix
+++ b/pkgs/tools/filesystems/go-mtpfs/default.nix
@@ -18,7 +18,11 @@ buildGoModule rec {
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libusb1 ];
 
-  checkFlags = [ "-short" ];
+  preCheck = ''
+    # Only run tests under mtp/encoding_test.go
+    # Other tests require an Android deviced attached over USB.
+    buildFlagsArray+=("-run" "Test(Encode|Decode|Variant).*")
+  '';
 
   meta = with lib; {
     description = "A simple FUSE filesystem for mounting Android devices as a MTP device";