diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-10 16:46:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-10 16:46:17 +0200 |
commit | 07282f01da06c158bab4787adc89ec15d7eeb202 (patch) | |
tree | ef74e4e842d0b3f04cd2ebb99f452ee2848f62a8 /src/testdir/check.vim | |
parent | a129974bc71fcb86e05a29387bcaba9aae2f296a (diff) | |
download | vim-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.vim | 10 |
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 |