about summary refs log tree commit diff
path: root/nixpkgs/pkgs/test
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-04-28 14:39:00 +0000
committerAlyssa Ross <hi@alyssa.is>2021-06-10 08:52:36 +0000
commit693e64ef7421374338ddb1dc12b9573feec75972 (patch)
tree2526ac075d248699c35d63e04499890ee4381f5f /nixpkgs/pkgs/test
parent7014df2256694d97093d6f2bb1db340d346dea88 (diff)
parent8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17 (diff)
downloadnixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.gz
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.bz2
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.lz
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.xz
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.zst
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.zip
Merge commit '8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17'
Diffstat (limited to 'nixpkgs/pkgs/test')
-rw-r--r--nixpkgs/pkgs/test/cuda/cuda-samples/default.nix8
-rw-r--r--nixpkgs/pkgs/test/cuda/default.nix2
-rw-r--r--nixpkgs/pkgs/test/default.nix2
-rw-r--r--nixpkgs/pkgs/test/vim/default.nix72
4 files changed, 74 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/test/cuda/cuda-samples/default.nix b/nixpkgs/pkgs/test/cuda/cuda-samples/default.nix
index 46d4d531690d..1a361c57214c 100644
--- a/nixpkgs/pkgs/test/cuda/cuda-samples/default.nix
+++ b/nixpkgs/pkgs/test/cuda/cuda-samples/default.nix
@@ -1,17 +1,9 @@
 { callPackage
-, cudatoolkit_9_2
 , cudatoolkit_10_0, cudatoolkit_10_1, cudatoolkit_10_2
 , cudatoolkit_11_0, cudatoolkit_11_1, cudatoolkit_11_2
 }:
 
 rec {
-  cuda-samples_cudatoolkit_9_2 = callPackage ./generic.nix {
-    cudatoolkit = cudatoolkit_9_2;
-    sha256 = "1ydankhyigcg99h0rqnmz1z4vc0sl6p9s1s0hbdxh5l1sx9141j6";
-  };
-
-  cuda-samples_cudatoolkit_9 = cuda-samples_cudatoolkit_9_2;
-
   ##
 
   cuda-samples_cudatoolkit_10_0 = callPackage ./generic.nix {
diff --git a/nixpkgs/pkgs/test/cuda/default.nix b/nixpkgs/pkgs/test/cuda/default.nix
index 9e7eaf8036a7..aac52e6a4f5d 100644
--- a/nixpkgs/pkgs/test/cuda/default.nix
+++ b/nixpkgs/pkgs/test/cuda/default.nix
@@ -3,8 +3,6 @@
 rec {
   cuda-samplesPackages = callPackage ./cuda-samples { };
   inherit (cuda-samplesPackages)
-    cuda-samples_cudatoolkit_9
-    cuda-samples_cudatoolkit_9_2
     cuda-samples_cudatoolkit_10
     cuda-samples_cudatoolkit_10_0
     cuda-samples_cudatoolkit_10_1
diff --git a/nixpkgs/pkgs/test/default.nix b/nixpkgs/pkgs/test/default.nix
index fa93ceb0721e..b24fc539c93d 100644
--- a/nixpkgs/pkgs/test/default.nix
+++ b/nixpkgs/pkgs/test/default.nix
@@ -41,6 +41,8 @@ with pkgs;
   rustCustomSysroot = callPackage ./rust-sysroot {};
   buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };
 
+  vim = callPackage ./vim {};
+
   nixos-functions = callPackage ./nixos-functions {};
 
   patch-shebangs = callPackage ./patch-shebangs {};
diff --git a/nixpkgs/pkgs/test/vim/default.nix b/nixpkgs/pkgs/test/vim/default.nix
new file mode 100644
index 000000000000..4ca004a60c34
--- /dev/null
+++ b/nixpkgs/pkgs/test/vim/default.nix
@@ -0,0 +1,72 @@
+{ vimUtils, vim_configurable, neovim, vimPlugins
+, lib, fetchFromGitHub,
+}:
+let
+  inherit (vimUtils) buildVimPluginFrom2Nix;
+
+  packages.myVimPackage.start = with vimPlugins; [ vim-nix ];
+in
+{
+  vim_empty_config = vimUtils.vimrcFile { beforePlugins = ""; customRC = ""; };
+
+  vim_with_vim2nix = vim_configurable.customize {
+    name = "vim"; vimrcConfig.vam.pluginDictionaries = [ "vim-addon-vim2nix" ];
+  };
+
+  # test cases:
+  test_vim_with_vim_nix_using_vam = vim_configurable.customize {
+   name = "vim-with-vim-addon-nix-using-vam";
+    vimrcConfig.vam.pluginDictionaries = [{name = "vim-nix"; }];
+  };
+
+  test_vim_with_vim_nix_using_pathogen = vim_configurable.customize {
+    name = "vim-with-vim-addon-nix-using-pathogen";
+    vimrcConfig.pathogen.pluginNames = [ "vim-nix" ];
+  };
+
+  test_vim_with_vim_nix_using_plug = vim_configurable.customize {
+    name = "vim-with-vim-addon-nix-using-plug";
+    vimrcConfig.plug.plugins = with vimPlugins; [ vim-nix ];
+  };
+
+  test_vim_with_vim_nix = vim_configurable.customize {
+    name = "vim-with-vim-addon-nix";
+    vimrcConfig.packages.myVimPackage.start = with vimPlugins; [ vim-nix ];
+  };
+
+  # only neovim makes use of `requiredPlugins`, test this here
+  test_nvim_with_vim_nix_using_pathogen = neovim.override {
+    configure.pathogen.pluginNames = [ "vim-nix" ];
+  };
+
+  # regression test for https://github.com/NixOS/nixpkgs/issues/53112
+  # The user may have specified their own plugins which may not be formatted
+  # exactly as the generated ones. In particular, they may not have the `pname`
+  # attribute.
+  test_vim_with_custom_plugin = vim_configurable.customize {
+    name = "vim_with_custom_plugin";
+    vimrcConfig.vam.knownPlugins =
+      vimPlugins // ({
+        vim-trailing-whitespace = buildVimPluginFrom2Nix {
+          name = "vim-trailing-whitespace";
+          src = fetchFromGitHub {
+            owner = "bronson";
+            repo = "vim-trailing-whitespace";
+            rev = "4c596548216b7c19971f8fc94e38ef1a2b55fee6";
+            sha256 = "0f1cpnp1nxb4i5hgymjn2yn3k1jwkqmlgw1g02sq270lavp2dzs9";
+          };
+          # make sure string dependencies are handled
+          dependencies = [ "vim-nix" ];
+        };
+      });
+    vimrcConfig.vam.pluginDictionaries = [ { names = [ "vim-trailing-whitespace" ]; } ];
+  };
+
+  # system remote plugin manifest should be generated, deoplete should be usable
+  # without the user having to do `UpdateRemotePlugins`. To test, launch neovim
+  # and do `:call deoplete#enable()`. It will print an error if the remote
+  # plugin is not registered.
+  test_nvim_with_remote_plugin = neovim.override {
+    configure.pathogen.pluginNames = with vimPlugins; [ deoplete-nvim ];
+  };
+}