Commit Graph

212 Commits

Author SHA1 Message Date
Justin M. Keyes
ae409b5042 test/win: use cmd.exe for test
Can revert this after #8120.
2018-03-18 17:15:06 +01:00
Justin M. Keyes
167898a517 test: jobstop() kills entire process tree
Test correctly fails before 8d90171f8b.
ref #6530
2018-03-18 17:03:05 +01:00
Justin M. Keyes
fd4021387e test: rename next_message() to next_msg() 2018-03-11 12:43:42 +01:00
Justin M. Keyes
2bf0869160 test: handle non-deterministic message cadence 2018-03-11 12:43:42 +01:00
Björn Linse
c57d315963
Merge pull request #8031 from bfredl/gotintstatus
jobwait: return -2 on interrupt even with timeout
2018-02-20 15:15:06 +01:00
Björn Linse
04fdbfe17d jobwait: return -2 on interrupt also with timeout 2018-02-20 12:32:23 +01:00
Jan Edmund Lazo
7fa69fb288 Resolve issues mentioned in PR review 2018-02-19 07:10:47 -05:00
Jan Edmund Lazo
3e19e18f4c win: enable job tests that use jobstart only
- echo "" does not hang in powershell
    - cmd.exe's echo command does not hang.
    - job tests default to powershell (WHY?)
- wait 5 seconds for powershell to create an empty file
    - powershell is slow
    - cannot reliably validate the id returned by jobstart via jobpid, jobstop
    - if using cmd.exe, waiting for a second should be enough
- remaining job tests are unreliable in Windows because any build can pass/fail
  for same conditions without changes, especially if the error is in stderr
2018-02-19 07:10:41 -05:00
Justin M. Keyes
e72ecdb7ca test/util: expect_msg_seq()
job_spec.lua on AppVeyor (Windows) often fails like this:

      FAILED  ] C:/projects/neovim/test/functional\core\job_spec.lua @ 72: jobs changes to given `cwd` directory
    C:/projects/neovim/test/functional\core\job_spec.lua:81: Expected objects to be the same.
    Passed in:
    (table) {
      [1] = 'notification'
      [2] = 'stdout'
     *[3] = {
        [1] = 0
       *[2] = {
          [1] = 'C:\projects\neovim\Xtest-tmpdir\nvimmSjq1S\0' } } }
    Expected:
    (table) {
      [1] = 'notification'
      [2] = 'stdout'
     *[3] = {
        [1] = 0
       *[2] = {
          [1] = 'C:\projects\neovim\Xtest-tmpdir\nvimmSjq1S\0'
         *[2] = '' } } }
    stack traceback:

Message chunking is non-deterministic, so we need to try different
variants.
2018-02-18 19:19:03 +01:00
George Zhao
499c9a1553 test/win: fix some environment assumptions #7912
fix #7909
fix #7910
2018-01-28 19:10:18 +01:00
Björn Linse
308dd53783 channel: check for existance before trying to set key
This avoids an error message in async context, where it is not safe.
2017-12-23 14:02:00 +01:00
ZyX
c49e22d396 Merge branch 'master' into s-dash-stdin 2017-12-03 16:49:30 +03:00
Björn Linse
e3c4c8a90e tests: mark flaky socket test pending for now 2017-11-27 11:43:24 +01:00
Björn Linse
91b856ccce channels: tests 2017-11-26 09:17:04 +01:00
Justin M. Keyes
54cac3033f test: startup_spec: cmd.exe escaping 2017-11-04 09:36:52 +01:00
Justin M. Keyes
68bef0a57d test: has("ttyin"), has("ttyout") 2017-11-04 09:36:52 +01:00
Josh Leeb-du Toit
9db42d4ce9 :cquit : take an error code argument #7336
closes #2699

ex_cmds.lua: use flags consistent with similar commands such as `cnext`.

upstream discussion:
"[patch] :qcuit can take exit code"
https://groups.google.com/d/msg/vim_dev/_PjyNbUKyRc/oPgr5_ZXc6AJ
2017-10-22 13:02:31 +02:00
Justin M. Keyes
6f7754dfa0 test: avoid extra clear() calls
also: various other cleanup
2017-10-02 01:46:16 +02:00
Ignas Anikevicius
2b133101cf win: vim_FullName(): force backslashes #7287
- Replace obvious cases of '/' literal with PATHSEP. (There are still
  some remaining cases that need closer inspection.)
- Fixup tests: ui/screen_basic

closes #7117
ref https://github.com/neovim/neovim/issues/2471#issuecomment-271193714
2017-10-02 00:48:30 +02:00
Drew Neil
ac52947838 Repair job_spec functional tests 2017-08-21 20:44:03 +01:00
Justin M. Keyes
92101947fe test: job_spec.lua: disable shada in test instance 2017-08-04 22:25:39 +02:00
ZyX
65fb622000 functests: Replace execute with either command or feed_command
Hope this will make people using feed_command less likely: this hides bugs.
Already found at least two:

1. msgpackparse() will show internal error: hash_add() in case of duplicate
   keys, though it will still work correctly. Currently silenced.
2. ttimeoutlen was spelled incorrectly, resulting in option not being set when
   expected. Test was still functioning somehow though. Currently fixed.
2017-04-09 03:24:08 +03:00
Justin M. Keyes
1ea9ebf112 test: Use workspace-local temp directory.
Closes #6291
2017-03-30 02:55:00 +02:00
ZyX
62108c3b0b functests: Disable system(-s -) test on Windows
Assume something with system() if second test hangs as well. Assume something 
with reading stdin if not.
2017-03-23 21:06:39 +03:00
ZyX
99b4f25b99 functests: Do not run termopen test on Windows 2017-03-23 21:04:45 +03:00
ZyX
7df4fc8941 functests: Test -s errors 2017-03-19 18:53:21 +03:00
ZyX
fdfa1ed578 main: Temporary fix assertion error
This variant uses `fdopen()` which is not standard, but it fixes problem on my 
system. In next commit `scriptin` will use `FileDescriptor*` from os/fileio in 
place of `FILE*`.
2017-03-19 16:09:48 +03:00
ZyX
d2268d5ebb functests: Do not check stdout, it is different on Windows 2017-03-19 14:13:21 +03:00
ZyX
29654cfee7 functests: Fix testlint errors 2017-03-19 14:13:21 +03:00
ZyX
d4639ea6d9 functests: Use Neovim instance and system() in place of lua io.popen 2017-03-19 14:13:21 +03:00
ZyX
38687ee394 functests: Make sure that line ending is LF and not CRLF 2017-03-19 14:13:21 +03:00
ZyX
1ea7541f65 functests: Alter the order of checks
Check whether `repeated_read_cmd` returned nil and did not actually run nvim or 
it did, but still returned nil for whatever reason.
2017-03-19 14:13:21 +03:00
ZyX
3cd7bf31e2 tests: Fix repeated_popen_r usage, rename the function 2017-03-19 14:13:21 +03:00
ZyX
0e9286a19e tests: Fix CI failures 2017-03-19 14:13:21 +03:00
ZyX
0320a58082 functests: Check that -s works as expected 2017-03-19 14:13:21 +03:00
Matthew Malcomson
f6946c68ae job-control: set CLOEXEC on pty processes. #5986
Before this change, new processes started with libuv prevented SIGHUP
from reaching pty processes (by keeping the ptmx file descriptor open).
2017-03-17 12:20:51 +01:00
James McCoy
d4dd447ded
win: test: Fix closure jobs test on Windows 2017-02-23 01:24:55 -05:00
Michael Ennen
ef8701610b Allow lambdas to be used with jobs, timers and dictwatchers. 2017-02-14 17:38:19 -07:00
Justin M. Keyes
bd16e116eb win: test: Enable jobstart() 'shell' test. (#5983) 2017-01-21 17:04:39 +01:00
Justin M. Keyes
7637df4b59 win: test: XXX: Disable some tests. 2017-01-19 09:55:57 +01:00
Justin M. Keyes
32c7971b2a win: fix warnings 2017-01-19 09:55:57 +01:00
Justin M. Keyes
e40946a5be win: test: enable job_spec.lua
- Default to powershell.
- Avoid hardcoded "-c".
- Remove ^M character from received lines.
- pending_win32(): clear() is unnecessary and it pollutes the tests.

Closes #3973
Helped-by: Rui Abreu Ferreira <raf-ep@gmx.com>
2017-01-19 09:55:57 +01:00
James McCoy
bde9bedb0b
job: Consume content from rbuffer before invoking the callback again
While a job callback is active, it may be invoked again.  Since the
data handled by the first invocation of the callback hasn't been marked
as consumed, the subsequent invocation will see the same data.

Reported-by: Daniel Hahler
Patch-by: oni-link
Closes #5889
2017-01-14 07:49:07 -05:00
Justin M. Keyes
82edcb593b Windows: enable more tests 2017-01-13 01:17:12 +01:00
Justin M. Keyes
c6a50ca82c test: jobclose(): Avoid indeterminism. (#5851)
stdout activity may reach the queue before `exit`; just discard it.

Observed on Travis CI, ubuntu "trusty" beta image:

    [ RUN      ] ...is/build/neovim/neovim/test/functional/core/job_spec.lua @ 509: jobs running tty-test program jobclose() sends SIGHUP
    ...is/build/neovim/neovim/test/functional/core/job_spec.lua:511: Expected objects to be the same.
    Passed in:
    (table) {
      [1] = 'notification'
     *[2] = 'stdout'
      [3] = {
        [1] = 0
        [2] = {
          [1] = '
    '
          [2] = '' } } }
    Expected:
    (table) {
      [1] = 'notification'
     *[2] = 'exit'
      [3] = {
        [1] = 0
        [2] = 42 } }
    stack traceback:
    	...is/build/neovim/neovim/test/functional/core/job_spec.lua:511: in function <...is/build/neovim/neovim/test/functional/core/job_spec.lua:509>
    [  FAILED  ] ...is/build/neovim/neovim/test/functional/core/job_spec.lua @ 509: jobs running tty-test program jobclose() sends SIGHUP (2.81 ms)
2016-12-31 08:59:44 -05:00
Justin M. Keyes
0b244de384 test: job_spec: Avoid unreliable screen test. 2016-12-23 18:28:54 +01:00
Justin M. Keyes
43ba7f4d98 eval.c: set_selfdict(): Fix invalid memory access. 2016-12-14 20:52:18 +01:00
Marco Hinz
5855f30cb1 Make VimL code compatible with merged Partial support (#5765)
Closes #5763.
2016-12-13 14:48:42 +01:00
Michael Ennen
5e4eb18eb0 Add some tests and cleanup. 2016-12-12 10:17:35 -05:00
Björn Linse
0f681c80e1 Make partials work with jobs, timers, and dictwatchers. 2016-12-12 10:17:35 -05:00
Justin M. Keyes
d32888073f test: jobstart() 2016-12-11 01:14:22 +01:00
Aaron Williamson
c8d5e9230e jobstart(): Return -1 if cmd is not executable. #5671
Closes #5465
2016-12-10 16:01:27 +01:00
Justin M. Keyes
933c873cae test: Handle SIGHUP in tty-test fixture.
Closes #5727
2016-12-07 17:22:37 +01:00
Marco Hinz
df2ffe48ce
Tests: add tests for v:exiting 2016-12-01 14:57:27 +01:00
Björn Linse
1d4563771b jobs: ensure calling jobclose() on a pty job sends SIGHUP. Closes #5619 2016-11-17 15:13:45 +01:00
Justin M. Keyes
6636e2a259 test: :terminal should not interrupt Press-ENTER
References #2748
2016-10-20 23:41:59 +02:00
Justin M. Keyes
ac819b8994 CI: Travis macOS: Skip tab left-drag tests.
These tests fail on master, so it's not a regression. Changes in #4874
(parent commit) seem to work (and pass most CI), so skipping these tests
is better than blocking the changes.
2016-09-12 03:42:51 +02:00
Rui Abreu Ferreira
9ce81f7b2b functionaltest: Create lua helper for os.tmpname()
In Windows Lua's os.tmpname() returns relative paths starting with \s,
prepend them with $TEMP to generate a valid path.

In OS X os.tmpname() returns paths in '/tmp' but they should be in
'/private/tmp'. We cannot use os_name() for platform detection because
some tests use tempname() before nvim is spawned, instead use one of the
following:

1. Set SYSTEM_NAME environment variable before calling the tests, it
   is set from CMAKE_SYSTEM_NAME(i.e. uname -s or 'Windows')
2. Call uname -s
3. Assume windows
2016-08-31 11:32:28 +01:00
Rui Abreu Ferreira
39c628d031 Mark some functional tests as pending in Windows 2016-08-26 08:21:41 +01:00
Björn Linse
2d60a15e25 job control: reuse common job code for rpc jobs
This makes stderr and exit callbacks work for rpc jobs
2016-08-20 12:55:35 +02:00
Justin M. Keyes
68d9198501 XXX: CI: Disable hanging test on Travis OSX.
Temporary change to avoid frequent hangs on Travis macOS/OSX builds.
Hang does not occur on Quickbuild OSX (Yosemite) build.
Reverting e9061117a5 avoids the hang, but causes
more serious regressions on many more systems.

Note that the job_spec hang only happens with the gcc-4.9 Travis OSX build.

References #5002
References #5029
2016-08-09 15:17:46 -04:00
Justin M. Keyes
ff93c9bd90 test: PTY descendants should not prevent exit. 2016-07-16 03:34:59 -04:00