aboutsummaryrefslogtreecommitdiff
path: root/test/unit/os/fs_spec.lua
Commit message (Collapse)AuthorAge
* tests: improve error message with literat "~" directory (#11032)Daniel Hahler2019-09-17
|
* build/tests: remove pre/uv.h #10531Daniel Hahler2019-07-28
| | | | | | Initially done in 28e59cb22, but does not appear to be necessary anymore. Uses UV_EEXIST directly, just like UV_ENOENT.
* test: cleanup, reduce verbosityJustin M. Keyes2019-06-01
|
* test: Rename includes/pre/uv-errno.h to includes/pre/uv.hJames McCoy2018-07-11
| | | | | | | | | | | | | | | | | | libuv users are only supposed to directly include uv.h. In v1.21.0, all the uv-*.h headers were renamed to uv/*.h, which caused the unit tests to fail with [123/125] Generating post/uv-errno.h FAILED: test/includes/post/uv-errno.h cd «SRCDIR»/src/neovim/build/test/includes && /usr/bin/clang -std=c99 -E -P «SRCDIR»/src/neovim/test/includes/pre/uv-errno.h -I/usr/include -I/usr/include -o «SRCDIR»/neovim/build/test/includes/post/uv-errno.h «SRCDIR»/src/neovim/test/includes/pre/uv-errno.h:1:10: error: 'uv-errno.h' file not found with <angled> include; use "quotes" instead #include <uv-errno.h> ^~~~~~~~~~~~ "uv-errno.h" The intention of the file is to extend libuv's error constants with more values used by the unit tests. This can just as easily be achieved without poking into pseudo-private header files.
* Merge branch 'master' into s-dash-stdinb-r-o-c-k2018-04-14
|\
| * refactor/rename: path_is_absolute()Justin M. Keyes2018-03-24
| |
* | Merge branch 'master' into s-dash-stdinZyX2017-12-03
|\|
| * os_stat: return ENOENT on NULL filename argJames McCoy2017-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #4370 Explication: In the backtrace in #4370, we see that `buf_write()` was called with non-NULL `fname` and `sfname` arguments, but they've since _become_ NULL. #7 0x00000000004de09d in buf_write (buf=0x1dee040, fname=0x0, fname@entry=0x1e985b0 "/home/sean/src/github.com/snczl/virta/pkg/meld/segment.go", sfname=0x0, sfname@entry=0x1ddfa60 "segment.go", start=1, end=72, eap=eap@entry=0x7ffc6b032e60, append=0, forceit=0, reset_changed=1, filtering=0) at /home/travis/build/neovim/bot-ci/build/neovim/src/nvim/fileio.c:2576 This is most likely due to the code that restores those values from `buf`, which happens just before the fatal call to `os_fileinfo` ```c /* * The autocommands may have changed the name of the buffer, which may * be kept in fname, ffname and sfname. */ if (buf_ffname) ffname = buf->b_ffname; if (buf_sfname) sfname = buf->b_sfname; if (buf_fname_f) fname = buf->b_ffname; if (buf_fname_s) fname = buf->b_sfname; ``` It's worth noting that at this point `ffname` is still non-NULL, so it _could_ be used. However, our current code is purely more strict than Vim in this area, which has caused us problems before (e.g., `getdigits()`). The commentary for `struct file_buffer` clearly indicate that all of `b_ffname`, `b_sfname`, and `b_fname` may be NULL: ```c /* * b_ffname has the full path of the file (NULL for no name). * b_sfname is the name as the user typed it (or NULL). * b_fname is the same as b_sfname, unless ":cd" has been done, * then it is the same as b_ffname (NULL for no name). */ char_u *b_ffname; /* full path file name */ char_u *b_sfname; /* short file name */ char_u *b_fname; /* current file name */ ``` Vim directly calls `stat(2)` which, although it is annotated to tell the compiler that the path argument is non-NULL, does handle a NULL pointer by returning a `-1` value and setting `errno` to `EFAULT`. This satisfies Vim's check, since it treats any `-1` return from `stat(2)` to mean the file doesn't exist (at least in this code path). Note that Vim's mch_stat() implementations on win32 and solaris clearly cannot accept NULL `name`. But the codepaths that call mch_stat will NULL `name` tend to be unix-only (eg: u_read_undo)!
| * test/fs: sanity check for literal "~" directory (#6579)Justin M. Keyes2017-04-24
| | | | | | | | If the CWD contains a directory with the literal name "~" then the tests will have bogus failures.
* | fileio,main: Do not restart syscall at EAGAIN when reading for -sZyX2017-03-19
| |
* | main: Temporary fix assertion errorZyX2017-03-19
|/ | | | | 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*`.
* unittests: Do not import libnvim or headers in main processZyX2017-03-11
| | | Slows down unit tests much, but gets rid of as much preserved state as possible.
* unittests: Check core dumps in after_each, like in functestsZyX2017-03-11
|
* unittests: Run all unit tests in their own processesZyX2017-03-11
| | | | | | | | | | | | | | | Used sed -r -i -e '/ helpers =/ s/$/\nlocal itp = helpers.gen_itp(it)/; s/^(\s*)it\(/\1itp(/' test/unit/**/*_spec.lua to alter all tests. Locally they all run fine now. Reasoning: 1. General: state from one test should not affect other tests. 2. Local: travis build is failing with something which may be an output of garbage collector. This should prevent state of the garbage collector from interferring as well.
* build: Do not force busted into front of $PATHJustin M. Keyes2017-02-04
| | | | | | | | | This was a workaround from long ago, but it doesn't seem to be needed anymore. And it breaks the $PATH on the Windows build (AppVeyor CI). After this change python3 (and 2) is correctly detected on AppVeyor CI. References #5946
* build: Target luacheck HEAD.Justin M. Keyes2016-11-17
| | | | | | | | | | | | https://github.com/mpeterv/luacheck/pull/81#issuecomment-261099606 > If you really want to use bleeding-edge version you should get the > rockspec from master branch, not a fixed commit ... > The correct way to install from a specific commit is cloning that > commit and running "luarocks make" from project directory. The reason > is that running "install" or "build" on an scm rockspec fetches > sources from master but uses build description from the rockspec > itself, which may be outdated.
* os/fs: Rename os_file_exists to os_path_exists (#4973)Daniel Xu2016-07-06
| | | | Because the old name did not indicate that the function would return true on directories as well.
* unittests: Fix bug somewhere that makes file_read tests SEGVZyX2016-06-24
|
* unittests: Add tests for file.cZyX2016-06-24
| | | | Also fixes some errors found.
* unittests: Add os_write testZyX2016-06-23
| | | New os/fs.c functions are now all tested.
* unittests: Add os_close, os_read and os_readv testsZyX2016-06-23
|
* os_nodetype: Return NODE_NORMAL if os_stat fails.Justin M. Keyes2016-05-22
| | | | | | | | Conforms to Vim's mch_nodetype. Regression by 7db4a15. buf_write() expects NODE_WRITABLE for character devices such as /dev/stderr. Closes #4772
* vim-patch:7.4.672KillTheMule2016-05-02
| | | | | | | | | | | Problem: When completing a shell command, directories in the current directory are not listed. Solution: When "." is not in $PATH also look in the current directory for directories. https://github.com/vim/vim/commit/b5971141dff0c69355fd64196fcc0d0d071d4c82 Most of it applied manually.
* test: sys/fcntl.h -> fcntl.hMichael Reed2016-01-14
| | | | | | | | | POSIX.1-2008[1] says that the latter should be used, and all of our supported platforms would seem to support this scheme, apparently even Windows[2]. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html [2]: https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx
* Use libuv errors instead of errno in unit testsRui Abreu Ferreira2015-11-25
| | | | | | | | Replaced old unit tests for errno with libuv error codes UV_ENOENT and UV_EEXIST (for os_open and os_getperms). Added libuv include path to test/includes compiler calls - needed to get hold of libuv headers.
* test/unit: clean up according to luacheckMarco Hinz2015-11-23
|
* os/fs: Allow os_mkdir_recurse directory name to end with ///ZyX2015-10-23
|
* os/fs.c: remove os_file_is_readonly()Justin M. Keyes2015-08-17
| | | | | | | | | | | | | | | | | | | os_file_is_readonly() in its current form is equivalent to !os_file_is_writable(). This does not appear to be a bug, because Vim's use of check_file_readonly() (which we changed to os_file_is_readonly()) is equivalent to !os_file_is_writable() in every case. os_file_is_readonly() also fails this test: returns false if the file is non-read, non-write A more useful form would define behavior under these cases: - path is executable (but not writable) - path is non-existent - path is directory But there is no reason for os_file_is_readonly() to exist, so remove it.
* test: more cases for os_file_is_readonly()Justin M. Keyes2015-08-17
|
* test: cover os_file_is_readable()Justin M. Keyes2015-08-17
|
* test: fix pending() invocationsJustin M. Keyes2015-08-09
| | | | | AFAICT busted does not report pending() invocations without the 2nd argument.
* os/fs: Move mkdir_recurse from eval.c to os/fs.cZyX2015-07-26
|
* event loop: New abstraction layer with refactored time/signal APIThiago de Arruda2015-07-17
| | | | | | | | | | - Add event loop abstraction module under src/nvim/event. The src/nvim/event/loop module replaces src/nvim/os/event - Remove direct dependency on libuv signal/timer API and use the new abstraction instead. - Replace all references to uv_default_loop() by &loop.uv, a new global variable that wraps libuv main event loop but allows the event loop functions to be reused in other contexts.
* tests: Use pending() instead of silently skipping test. #2737Florian Walch2015-05-29
|
* Use lfs.currentdir() to fix symlink test fail.Rich Churcher2015-04-01
|
* Merge pull request #1965 from jszakmeister/fix-fs-spec-test-for-freebsdJohn Szakmeister2015-02-11
|\ | | | | Fix an fs_spec test under FreeBSD and a symlinked home directory.
| * Fix an fs_spec test under FreeBSD and a symlinked home directory.John Szakmeister2015-02-09
| | | | | | | | | | | | | | | | | | | | It turns out the FreeBSD 10 VM has a symlink for the home directory to /usr/home. Unfortunately, this breaks the test as arg[0] may not have the symlink resolved, but the path returned from the exe() call will. As a result, the comparison fails, even though the result is correct. Let's fix this by running the absolute path through exe() too, and then comparing the results.
* | Get rid of a bashism in the fs_spec test. #1964John Szakmeister2015-02-09
|/ | | | | FreeBSD doesn't use bash by default, causing the group id to be print out in the middle of the test.
* test/os/fs: fix call to lfs.attributesNicolas Hillegeer2015-01-16
| | | | | | | | The second argument to lfs.attributes() serves only to select a specific part of the normally returned table. It's not a file open flag (e.g.: as for fopen() in C). Also made the (n)eq checks a bit more idiomatic. Fixes #1831
* update os_can_exe unit testScott Prager2014-09-17
|
* vim-patch:7.4.235Scott Prager2014-09-17
| | | | | | | Problem: It is not easy to get the full path of a command. Solution: Add the exepath() function. https://code.google.com/p/vim/source/detail?r=5ab2946f7ce560985830fbc3c453bb0f7a01f385
* unit tests: avoid global scope; add missing cimportsJustin M. Keyes2014-09-11
| | | | temporarily comment out call to vim_deltempdir() to avoid segfault
* fileid: rename os_file_id_equal_file_infoStefan Hoffmann2014-08-31
|
* fileid: rename os_file_id_equalStefan Hoffmann2014-08-31
|
* fileid: rename os_get_file_idStefan Hoffmann2014-08-31
|
* fileinfo: rename os_file_info_get_inodeStefan Hoffmann2014-08-31
|
* fileinfo: rename os_file_info_get_idStefan Hoffmann2014-08-31
|
* fileinfo: rename os_file_info_id_equalStefan Hoffmann2014-08-31
|
* fileinfo: rename os_get_file_info{,_link,_fd}Stefan Hoffmann2014-08-31
|
* fileinfo: implement os_fileinfo_blocksizeStefan Hoffmann2014-08-31
|