diff src/testdir/check.vim @ 18277:f6dcf7eabd26 v8.1.2133

patch 8.1.2133: some tests fail when run as root Commit: https://github.com/vim/vim/commit/07282f01da06c158bab4787adc89ec15d7eeb202 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 10 16:46:17 2019 +0200 patch 8.1.2133: some tests fail when run as root Problem: Some tests fail when run as root. Solution: Add CheckNotRoot and use it. (James McCoy, closes https://github.com/vim/vim/issues/5020)
author Bram Moolenaar <Bram@vim.org>
date Thu, 10 Oct 2019 17:00:03 +0200
parents 923154c51bef
children 97d534e17874
line wrap: on
line diff
--- a/src/testdir/check.vim
+++ b/src/testdir/check.vim
@@ -1,3 +1,5 @@
+source shared.vim
+
 " Command to check for the presence of a feature.
 command -nargs=1 CheckFeature call CheckFeature(<f-args>)
 func CheckFeature(name)
@@ -102,3 +104,11 @@ func CheckNotGui()
     throw 'Skipped: only works in the terminal'
   endif
 endfunc
+
+" Command to check that test is not running as root
+command CheckNotRoot call CheckNotRoot()
+func CheckNotRoot()
+  if IsRoot()
+    throw 'Skipped: cannot run test as root'
+  endif
+endfunc