aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
| * | | | | | refactor/rename: path_is_absolute()Justin M. Keyes2018-03-24
| | | | | | |
| * | | | | | provider/RPC: apply_autocmds_group(): fix double-freeJustin M. Keyes2018-03-24
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During provider dispatch, eval_call_provider() saves global state--including pointers, such as `autocmd_fname`--into `provider_caller_scope` which is later restored by f_rpcrequest(). But `autocmd_fname` is special-cased in eval_vars(), for performance (see Vim patch 7.2.021; this is also the singular purpose of the `autocmd_fname_full` global. Yay!) If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias becomes a problem. Solution: Don't free autocmd_fname in eval_vars(), just copy into it. closes #5245 closes #5617 Reference ------------------------------------------------------------------------ Vim patch 7.2.021 https://github.com/vim/vim/commit/f6dad43c98f47da1ff9d8c99b320fc3674f83c63 Problem: When executing autocommands getting the full file name may be slow. (David Kotchan) Solution: Postpone calling FullName_save() until autocmd_fname is used. vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when Editing Files on a Remote WIndows Share" https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ
| * | | | | test/win: use cmd.exe for testJustin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | Can revert this after #8120.
| * | | | | test: jobstop() kills entire process treeJustin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test correctly fails before 8d90171f8be6. ref #6530
| * | | | | API: nvim_get_proc()Justin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TODO: "exepath" field (win32: QueryFullProcessImageName()) On unix-likes `ps` is used because the platform-specific APIs are a nightmare. For reference, below is a (incomplete) attempt: diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c index 09769925aca5..99afbbf290c1 100644 --- a/src/nvim/os/process.c +++ b/src/nvim/os/process.c @@ -208,3 +210,60 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count) return 0; } +/// Gets various properties of the process identified by `pid`. +/// +/// @param pid Process to inspect. +/// @return Map of process properties, empty on error. +Dictionary os_proc_info(int pid) +{ + Dictionary pinfo = ARRAY_DICT_INIT; +#ifdef WIN32 + +#elif defined(__APPLE__) + char buf[PROC_PIDPATHINFO_MAXSIZE]; + if (proc_pidpath(pid, buf, sizeof(buf))) { + name = getName(buf); + PUT(pinfo, "exepath", STRING_OBJ(cstr_to_string(buf))); + return name; + } else { + ILOG("proc_pidpath() failed for pid: %d", pid); + } +#elif defined(BSD) +# if defined(__FreeBSD__) +# define KP_COMM(o) o.ki_comm +# else +# define KP_COMM(o) o.p_comm +# endif + struct kinfo_proc *proc = kinfo_getproc(pid); + if (proc) { + PUT(pinfo, "name", cstr_to_string(KP_COMM(proc))); + xfree(proc); + } else { + ILOG("kinfo_getproc() failed for pid: %d", pid); + } + +#elif defined(__linux__) + char fname[256] = { 0 }; + char buf[MAXPATHL]; + snprintf(fname, sizeof(fname), "/proc/%d/comm", pid); + FILE *fp = fopen(fname, "r"); + // FileDescriptor *f = file_open_new(&error, fname, kFileReadOnly, 0); + // ptrdiff_t file_read(FileDescriptor *const fp, char *const ret_buf, + // const size_t size) + if (fp == NULL) { + ILOG("fopen() of /proc/%d/comm failed", pid); + } else { + size_t n = fread(buf, sizeof(char), sizeof(buf) - 1, fp); + if (n == 0) { + WLOG("fread() of /proc/%d/comm failed", pid); + } else { + size_t end = MIN(sizeof(buf) - 1, n); + end = (end > 0 && buf[end - 1] == '\n') ? end - 1 : end; + buf[end] = '\0'; + PUT(pinfo, "name", STRING_OBJ(cstr_to_string(buf))); + } + } + fclose(fp); +#endif + return pinfo; +}
| * | | | | API: nvim_get_proc_children()Justin M. Keyes2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | ref https://github.com/libuv/libuv/pull/836
| * | | | | test: use luv.now() instead of os.time()Justin M. Keyes2018-03-16
| | | | | |
| * | | | | DirChanged: support <buffer> (#8140)Marco Hinz2018-03-16
| | |_|/ / | |/| | |
| * | | | test: next_msg(): default `timeout` to 10sJustin M. Keyes2018-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Infinite timeout results in hangs which waste time. If some test needs longer than 10s to wait for a message, it should specify the timeout explicitly.
| * | | | test: rename next_message() to next_msg()Justin M. Keyes2018-03-11
| | | | |
| * | | | test: handle non-deterministic message cadenceJustin M. Keyes2018-03-11
| | | | |
| * | | | Merge #8084 'build/win: support MSVC'Justin M. Keyes2018-03-08
| |\ \ \ \
| | * | | | build/msvc: Make shell-test fix only apply to MSCVb-r-o-c-k2018-03-06
| | | | | |
| | * | | | build/msvc: Make shell-test workb-r-o-c-k2018-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC doesn't have unistd.h or usleep() so it was replaced with the Sleep() WinAPI function.
| * | | | | message: don't output unprintable chars to screenBjörn Linse2018-03-04
| | | | | | | | | | | | | | | | | | | | | | | | fixes #7586 #8070
| * | | | | api: nvim_list_uis #8004geekodour2018-03-03
| |/ / / / | | | | | | | | | | | | | | | | | | | | ref #7438 closes #4842
| * | | | unittest: Ignore all _Float-prefixed types (#8067)James McCoy2018-02-25
| | | | | | | | | | | | | | | | | | | | Previously, we ignored only _Float128. But glibc 2.27 added _Float32 and _Float32x. Rather than play whack-a-mole, ignore everything.
| * | | | 'fillchars': fix defaults logic; handle ambiwidth=double #7986Matthieu Coudron2018-02-23
| | | | | | | | | | | | | | | | | | | | Update tests.
| * | | | Merge pull request #8031 from bfredl/gotintstatusBjörn Linse2018-02-20
| |\ \ \ \ | | | | | | | | | | | | jobwait: return -2 on interrupt even with timeout
| | * | | | jobwait: return -2 on interrupt also with timeoutBjörn Linse2018-02-20
| | | | | |
| * | | | | Resolve issues mentioned in PR reviewJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | test: win: emulate yes with for loopJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | test: win: enable ui/wildmode_spec.luaJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | test: win: enable termclose_spec.luaJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | test: enable ex_cmds/cd_spec.lua on WindowsJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | test: enable legacy/fixeol_spec in WindowsJan Edmund Lazo2018-02-19
| | | | | | | | | | | | | | | | | | | | | | | | Try nvim's delete() for cross-platform file remove in Windows
| * | | | | test: enable ex_cmds/write_spec.lua in WindowsJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy test 051Jan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy test 059Jan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy test 107Jan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy test 093Jan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy/arglist_spec.luaJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy test 30Jan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy/getcwd_spec.luaJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy/wordcount_spec.luaJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy/packadd_spec.luaJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy test 011Jan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy/delete_spec.luaJan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy test 097Jan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable legacy test 025Jan Edmund Lazo2018-02-19
| | | | | |
| * | | | | win: enable job tests that use jobstart onlyJan Edmund Lazo2018-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
| * | | | | vim-patch:8.0.1493: completion items cannot be annotated (#8003)Shougo2018-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Completion items cannot be annotated. Solution: Add a "user_data" entry to the completion item. (Ben Jackson, coses vim/vim#2608, closes vim/vim#2508) https://github.com/vim/vim/commit/9b56a57cdae31f7a2c85d440392bf63d3253a158
| * | | | | test/util: remove eq_any()Justin M. Keyes2018-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was added in the parent commit, but ended up not being used. And I can't think of a case where it will be used: instead we would probably want to generalize expect_msg_seq() if necessary.
| * | | | | test/util: expect_msg_seq()Justin M. Keyes2018-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | vim-patch-8.0.0649 and vim-patch-8.0.0650: autocmd open help 2 timesNimit Bhardwaj2018-02-17
| |/ / / /
| * | | | Merge pull request #8008 from bfredl/arrayfreeBjörn Linse2018-02-14
| |\ \ \ \ | | | | | | | | | | | | ex_getln: clear cmdline_block after it's freed
| | * | | | ex_getln: clear cmdline_block after it's freedBjörn Linse2018-02-14
| | | | | |
| * | | | | ui: refactor ui optionsBjörn Linse2018-02-13
| |/ / / /
| * | | | test/python: less-noisy Python skip-messageJustin M. Keyes2018-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | Developer can use :checkhealth to get more details, don't need to blast the details in the skip-message every time.
| * | | | test/arglist_spec: update to Vim 8.0.0721 behaviorJustin M. Keyes2018-02-11
| | | | |