aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-05 10:17:37 +0200
committerGitHub <noreply@github.com>2019-08-05 10:17:37 +0200
commit51440204e7973672f906db8e53035cfd228ce444 (patch)
tree6c69695a8822cb42c4d5f1ff1cf23b440d9455ff
parent6871445dfe80939df81517870f0b29a2b40dd9d9 (diff)
parentd4a0b6c4e1d78f19bf5879b113c5252d5a4f2e5c (diff)
downloadrneovim-51440204e7973672f906db8e53035cfd228ce444.tar.gz
rneovim-51440204e7973672f906db8e53035cfd228ce444.tar.bz2
rneovim-51440204e7973672f906db8e53035cfd228ce444.zip
Merge #10695 from justinmk/test-fixes
test: various fixes
-rw-r--r--test/functional/api/server_requests_spec.lua4
-rw-r--r--test/functional/autocmd/termclose_spec.lua2
-rw-r--r--test/functional/core/job_spec.lua2
-rw-r--r--test/functional/ex_cmds/ctrl_c_spec.lua2
-rw-r--r--test/functional/plugin/man_spec.lua2
-rw-r--r--test/functional/ui/output_spec.lua2
-rw-r--r--test/helpers.lua12
-rw-r--r--test/unit/mbyte_spec.lua3
8 files changed, 16 insertions, 13 deletions
diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua
index 07218f11dd..dbe9f20412 100644
--- a/test/functional/api/server_requests_spec.lua
+++ b/test/functional/api/server_requests_spec.lua
@@ -181,7 +181,7 @@ describe('server -> client', function()
end)
describe('recursive (child) nvim client', function()
- if os.getenv("TRAVIS") and helpers.os_name() == "osx" then
+ if helpers.isCI('travis') and helpers.os_name() == 'osx' then
-- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86.
pending("[Hangs on Travis macOS. #5002]", function() end)
return
@@ -340,7 +340,7 @@ describe('server -> client', function()
describe('connecting to its own pipe address', function()
it('does not deadlock', function()
- if not os.getenv("TRAVIS") and helpers.os_name() == "osx" then
+ if not helpers.isCI('travis') and helpers.os_name() == 'osx' then
-- It does, in fact, deadlock on QuickBuild. #6851
pending("deadlocks on QuickBuild", function() end)
return
diff --git a/test/functional/autocmd/termclose_spec.lua b/test/functional/autocmd/termclose_spec.lua
index 26f2b5da1b..50bcf1af5a 100644
--- a/test/functional/autocmd/termclose_spec.lua
+++ b/test/functional/autocmd/termclose_spec.lua
@@ -22,7 +22,7 @@ describe('TermClose event', function()
command('terminal')
-- shell-test exits immediately.
retry(nil, nil, function() neq(-1, eval('jobwait([&channel], 0)[0]')) end)
- eq(23, eval('g:test_termclose'))
+ retry(nil, nil, function() eq(23, eval('g:test_termclose')) end)
end)
it('triggers when long-running terminal job gets stopped', function()
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 2b00327f14..212b76b5d9 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -205,7 +205,7 @@ describe('jobs', function()
end)
it("will not buffer data if it doesn't end in newlines", function()
- if os.getenv("TRAVIS") and os.getenv("CC") == "gcc-4.9"
+ if helpers.isCI('travis') and os.getenv('CC') == 'gcc-4.9'
and helpers.os_name() == "osx" then
-- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86.
pending("[Hangs on Travis macOS. #5002]", function() end)
diff --git a/test/functional/ex_cmds/ctrl_c_spec.lua b/test/functional/ex_cmds/ctrl_c_spec.lua
index 4c5383b712..f65d9f0d01 100644
--- a/test/functional/ex_cmds/ctrl_c_spec.lua
+++ b/test/functional/ex_cmds/ctrl_c_spec.lua
@@ -11,7 +11,7 @@ describe("CTRL-C (mapped)", function()
it("interrupts :global", function()
-- Crashes luajit.
if helpers.skip_fragile(pending,
- os.getenv("TRAVIS") or os.getenv("APPVEYOR")) then
+ helpers.isCI('travis') or helpers.isCI('appveyor')) then
return
end
diff --git a/test/functional/plugin/man_spec.lua b/test/functional/plugin/man_spec.lua
index b25bd7e85a..d95995797e 100644
--- a/test/functional/plugin/man_spec.lua
+++ b/test/functional/plugin/man_spec.lua
@@ -1,5 +1,4 @@
local helpers = require('test.functional.helpers')(after_each)
-local plugin_helpers = require('test.functional.plugin.helpers')
local Screen = require('test.functional.ui.screen')
local command, eval, rawfeed = helpers.command, helpers.eval, helpers.rawfeed
local clear = helpers.clear
@@ -9,7 +8,6 @@ describe(':Man', function()
local screen
before_each(function()
- plugin_helpers.reset()
clear()
command('syntax on')
command('set filetype=man')
diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua
index 38c4527a5b..9a30ea73c4 100644
--- a/test/functional/ui/output_spec.lua
+++ b/test/functional/ui/output_spec.lua
@@ -52,7 +52,7 @@ describe("shell command :!", function()
it("throttles shell-command output greater than ~10KB", function()
if helpers.skip_fragile(pending,
- (os.getenv("TRAVIS") and helpers.os_name() == "osx")) then
+ (helpers.isCI('travis') and helpers.os_name() == 'osx')) then
return
end
child_session.feed_data(
diff --git a/test/helpers.lua b/test/helpers.lua
index 5739b42fe6..e14bcff2c8 100644
--- a/test/helpers.lua
+++ b/test/helpers.lua
@@ -674,11 +674,13 @@ function module.write_file(name, text, no_dedent, append)
file:close()
end
-function module.isCI()
- local is_travis = nil ~= os.getenv('TRAVIS')
- local is_appveyor = nil ~= os.getenv('APPVEYOR')
- local is_quickbuild = nil ~= lfs.attributes('/usr/home/quickbuild')
- return is_travis or is_appveyor or is_quickbuild
+function module.isCI(name)
+ local any = (name == nil)
+ assert(any or name == 'appveyor' or name == 'quickbuild' or name == 'travis')
+ local av = ((any or name == 'appveyor') and nil ~= os.getenv('APPVEYOR'))
+ local tr = ((any or name == 'travis') and nil ~= os.getenv('TRAVIS'))
+ local qb = ((any or name == 'quickbuild') and nil ~= lfs.attributes('/usr/home/quickbuild'))
+ return tr or av or qb
end
-- Gets the contents of $NVIM_LOG_FILE for printing to the build log.
diff --git a/test/unit/mbyte_spec.lua b/test/unit/mbyte_spec.lua
index 3e65537270..1ff1bed9fe 100644
--- a/test/unit/mbyte_spec.lua
+++ b/test/unit/mbyte_spec.lua
@@ -8,6 +8,9 @@ local mbyte = helpers.cimport("./src/nvim/mbyte.h")
local charset = helpers.cimport('./src/nvim/charset.h')
describe('mbyte', function()
+ if helpers.isCI('quickbuild') then
+ pending("crashes on quickbuild", function() end)
+ end
-- Array for composing characters
local intp = ffi.typeof('int[?]')