summaryrefslogtreecommitdiff
path: root/src/testdir/check.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-10 16:46:17 +0200
committerBram Moolenaar <Bram@vim.org>2019-10-10 16:46:17 +0200
commit07282f01da06c158bab4787adc89ec15d7eeb202 (patch)
treeef74e4e842d0b3f04cd2ebb99f452ee2848f62a8 /src/testdir/check.vim
parenta129974bc71fcb86e05a29387bcaba9aae2f296a (diff)
downloadvim-git-07282f01da06c158bab4787adc89ec15d7eeb202.tar.gz
patch 8.1.2133: some tests fail when run as rootv8.1.2133
Problem: Some tests fail when run as root. Solution: Add CheckNotRoot and use it. (James McCoy, closes #5020)
Diffstat (limited to 'src/testdir/check.vim')
-rw-r--r--src/testdir/check.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/check.vim b/src/testdir/check.vim
index f176f8332..6c3b1be4f 100644
--- 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