aboutsummaryrefslogtreecommitdiff
path: root/test/functional
Commit message (Collapse)AuthorAge
* eval: Silence PVS/V547: E882 may be triggeredZyX2018-04-15
| | | | | | | | | | I failed to deduce why analyzer thinks E882 may not be triggered, though conditions for triggering it are strange: it would trigger E882 only in the single case “function returned non-number”. Cases “function thrown exception”, or “built-in sorter encountered error” will neither yield E882 nor stop sort()/uniq(). Note though that searching test code revealed that neither E702 nor E882 are not tested anywhere.
* msg: do not scroll entire screen (#8088)Björn Linse2018-03-31
|
* Merge branch 'master' into yagebu/option-fixesJames McCoy2018-03-28
|\
| * Merge #8183 'build/msvc: Fix functional tests'Justin M. Keyes2018-03-27
| |\ | | | | | | | | | | | | | | | | | | | | | MSBuild still returns a non-zero exit code because it detects the word "error" in the stdout which is caused by some of the test names such as api/buf {get,set,del}_line get_line : out-of-bounds is an error. CMake mailing list thread: https://cmake.org/pipermail/cmake-developers/2015-October/026775.html There isn't any good solution for it, so I modified the build script to detect the error message printed by RunTests.cmake.
| | * build/msvc: Fix check for cksum on Windowsb-r-o-c-k2018-03-26
| | |
| * | TUI: implement "standout" attribute #8081Nimit Bhardwaj2018-03-27
| |/ | | | | | | closes #8054
| * *: Make sure that !did_throw implies !current_exceptionZyX2018-03-25
| | | | | | | | Fixes #7876
| * test: lua test for vim-patch:8.0.0184Nimit Bhardwaj2018-03-24
| | | | | | | | https://github.com/vim/vim/commit/2b7bc567b9238aaac682236cb4f727d0376e1302
| * win: defaults: 'shellcmdflag', 'shellxquote' #7343Jan Edmund Lazo2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | closes #7698 Wrapping a command in double-quotes allows cmd.exe to safely dequote the entire command as if the user entered the entire command in an interactive prompt. This reduces the need to escape nested and uneven double quotes. The `/s` flag of cmd.exe makes the behaviour more reliable: :set shellcmdflag=/s\ /c Before this patch, cmd.exe cannot use cygwin echo.exe (as opposed to cmd.exe `echo` builtin) even if it is wrapped in double quotes. Example: :: internal echo > cmd /s /c " echo foo\:bar" " foo\:bar" :: cygwin echo.exe > cmd /s /c " "echo" foo\:bar" " foo:bar
| * Merge #4419 'implement <Cmd> key'Justin M. Keyes2018-03-24
| |\
| | * getchar: implement <Cmd> key to invoke command in any modeBjörn Linse2018-03-23
| | |
| * | 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
| * '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