mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	Merge #5488 from justinmk/test-fix-mouse-drag
test: Disable unreliable test on travis+ASAN_UBSAN
This commit is contained in:
		@@ -481,10 +481,9 @@ describe('jobs', function()
 | 
			
		||||
      eq('rows: 40, cols: 10', next_chunk())
 | 
			
		||||
    end)
 | 
			
		||||
 | 
			
		||||
    it('calling jobclose()', function()
 | 
			
		||||
      -- this should send SIGHUP to the process
 | 
			
		||||
    it('jobclose() sends SIGHUP', function()
 | 
			
		||||
      nvim('command', 'call jobclose(j)')
 | 
			
		||||
      eq({'notification', 'exit', {0, 1}}, next_msg())
 | 
			
		||||
      eq({'notification', 'exit', {0, 42}}, next_msg())
 | 
			
		||||
    end)
 | 
			
		||||
  end)
 | 
			
		||||
end)
 | 
			
		||||
 
 | 
			
		||||
@@ -32,11 +32,21 @@ static void walk_cb(uv_handle_t *handle, void *arg) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifndef WIN32
 | 
			
		||||
static void sigwinch_handler(int signum)
 | 
			
		||||
static void sig_handler(int signum)
 | 
			
		||||
{
 | 
			
		||||
  switch(signum) {
 | 
			
		||||
  case SIGWINCH: {
 | 
			
		||||
    int width, height;
 | 
			
		||||
    uv_tty_get_winsize(&tty, &width, &height);
 | 
			
		||||
    fprintf(stderr, "rows: %d, cols: %d\n", height, width);
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  case SIGHUP:
 | 
			
		||||
    exit(42);  // arbitrary exit code to test against
 | 
			
		||||
    return;
 | 
			
		||||
  default:
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -141,7 +151,8 @@ int main(int argc, char **argv)
 | 
			
		||||
  struct sigaction sa;
 | 
			
		||||
  sigemptyset(&sa.sa_mask);
 | 
			
		||||
  sa.sa_flags = 0;
 | 
			
		||||
  sa.sa_handler = sigwinch_handler;
 | 
			
		||||
  sa.sa_handler = sig_handler;
 | 
			
		||||
  sigaction(SIGHUP, &sa, NULL);
 | 
			
		||||
  sigaction(SIGWINCH, &sa, NULL);
 | 
			
		||||
  // uv_signal_t sigwinch_watcher;
 | 
			
		||||
  // uv_signal_init(uv_default_loop(), &sigwinch_watcher);
 | 
			
		||||
@@ -150,5 +161,8 @@ int main(int argc, char **argv)
 | 
			
		||||
#endif
 | 
			
		||||
  uv_run(uv_default_loop(), UV_RUN_DEFAULT);
 | 
			
		||||
 | 
			
		||||
  // XXX: Without this the SIGHUP handler is skipped on some systems.
 | 
			
		||||
  sleep(100);
 | 
			
		||||
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -243,6 +243,19 @@ local function connect(file_or_address)
 | 
			
		||||
  return Session.new(stream)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Calls fn() until it returns without error, up to `max` times.
 | 
			
		||||
local function retry(fn, max)
 | 
			
		||||
  local retries = max and (max - 1) or 2
 | 
			
		||||
  for _ = 1, retries do
 | 
			
		||||
    local success = pcall(fn)
 | 
			
		||||
    if success then
 | 
			
		||||
      return
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
  -- pcall() is not used for the final attempt so failure can bubble up.
 | 
			
		||||
  fn()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function clear(...)
 | 
			
		||||
  local args = {unpack(nvim_argv)}
 | 
			
		||||
  local new_args
 | 
			
		||||
@@ -530,6 +543,7 @@ return function(after_each)
 | 
			
		||||
    prepend_argv = prepend_argv,
 | 
			
		||||
    clear = clear,
 | 
			
		||||
    connect = connect,
 | 
			
		||||
    retry = retry,
 | 
			
		||||
    spawn = spawn,
 | 
			
		||||
    dedent = dedent,
 | 
			
		||||
    source = source,
 | 
			
		||||
 
 | 
			
		||||
@@ -98,15 +98,7 @@ describe('undo tree:', function()
 | 
			
		||||
        expect_line('123456abc')
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      -- Retry up to 3 times. pcall() is _not_ used for the final attempt, so
 | 
			
		||||
      -- that failure messages can bubble up.
 | 
			
		||||
      for _ = 1, 2 do
 | 
			
		||||
        local success = pcall(test_earlier_later)
 | 
			
		||||
        if success then
 | 
			
		||||
          return
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
      test_earlier_later()
 | 
			
		||||
      helpers.retry(test_earlier_later)
 | 
			
		||||
    end)
 | 
			
		||||
 | 
			
		||||
    it('file-write specifications', function()
 | 
			
		||||
 
 | 
			
		||||
@@ -153,8 +153,9 @@ describe('Mouse input', function()
 | 
			
		||||
    end)
 | 
			
		||||
 | 
			
		||||
    it('in tabline to the left moves tab left', function()
 | 
			
		||||
      if os.getenv("TRAVIS") and helpers.os_name() == "osx" then
 | 
			
		||||
        pending("[Fails on Travis macOS. #4874]", function() end)
 | 
			
		||||
      if os.getenv("TRAVIS") and (helpers.os_name() == "osx"
 | 
			
		||||
          or os.getenv("CLANG_SANITIZER") == "ASAN_UBSAN") then
 | 
			
		||||
        pending("[Fails on Travis macOS, ASAN_UBSAN. #4874]", function() end)
 | 
			
		||||
        return
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
@@ -256,8 +257,9 @@ describe('Mouse input', function()
 | 
			
		||||
    end)
 | 
			
		||||
 | 
			
		||||
    it('out of tabline to the left moves tab left', function()
 | 
			
		||||
      if os.getenv("TRAVIS") and helpers.os_name() == "osx" then
 | 
			
		||||
        pending("[Fails on Travis macOS. #4874]", function() end)
 | 
			
		||||
      if os.getenv("TRAVIS") and (helpers.os_name() == "osx"
 | 
			
		||||
          or os.getenv("CLANG_SANITIZER") == "ASAN_UBSAN") then
 | 
			
		||||
        pending("[Fails on Travis macOS, ASAN_UBSAN. #4874]", function() end)
 | 
			
		||||
        return
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user