Commit Graph
98 Commits
Author SHA1 Message Date
Justin M. Keyes 99a9161bac unit tests: initialize everything 2014-09-11 08:58:17 +00:00
Justin M. Keyes f6088e79b0 unit tests: avoid global scope; add missing cimports
temporarily comment out call to vim_deltempdir() to avoid segfault
2014-09-11 05:17:52 +00:00
Justin M. Keyes c76feb338a unit tests: helpers.lua: hack to avoid empty popen() result 2014-09-11 05:17:52 +00:00
Stefan Hoffmann 10813ce38c fileid: rename os_file_id_equal_file_info 2014-08-31 15:47:43 +02:00
Stefan Hoffmann 3cf7a17a44 fileid: rename os_file_id_equal 2014-08-31 15:47:36 +02:00
Stefan Hoffmann 4e43095ab2 fileid: rename os_get_file_id 2014-08-31 15:43:40 +02:00
Stefan Hoffmann 8a66f4f245 fileinfo: rename os_file_info_get_inode 2014-08-31 15:42:19 +02:00
Stefan Hoffmann 6e3dce144a fileinfo: rename os_file_info_get_id 2014-08-31 15:41:03 +02:00
Stefan Hoffmann edcc1a9732 fileinfo: rename os_file_info_id_equal 2014-08-31 15:39:33 +02:00
Stefan Hoffmann 5d074a0aa6 fileinfo: rename os_get_file_info{,_link,_fd} 2014-08-31 15:37:55 +02:00
Stefan Hoffmann 9ee1c3604c fileinfo: implement os_fileinfo_blocksize 2014-08-31 15:33:23 +02:00
Stefan Hoffmann e85fe0957d fileinfo: implement os_fileinfo_hardlinks 2014-08-31 15:22:38 +02:00
Stefan Hoffmann aa378acdf5 fileinfo: implement os_fileinfo_size
this replaces os_get_file_size and file_info.stat.st_size
2014-08-31 15:15:02 +02:00
Stefan Hoffmann c798611771 unittest: Move FileInfo tests one level up 2014-08-31 14:50:50 +02:00
Thiago de Arruda 7b41fb383a unittest: Remove remaining moonscript references 2014-08-31 14:50:49 +02:00
Thiago de Arruda 38b7b4405e unittest: convert set.moon to lua 2014-08-31 14:50:49 +02:00
Thiago de Arruda 3a951112c0 unittest: convert preprocess.moon to lua 2014-08-31 14:50:49 +02:00
Thiago de Arruda d74ae5be9d unittest: convert users_spec.moon to lua 2014-08-31 14:50:49 +02:00
Thiago de Arruda df50d242f5 unittest: convert path_spec.moon to lua 2014-08-31 14:50:49 +02:00
Thiago de Arruda 227e38f0c6 unittest: convert fs_spec.moon to lua 2014-08-31 14:50:49 +02:00
Thiago de Arruda d39aa51e94 unittest: convert env_spec.moon to lua 2014-08-31 14:50:49 +02:00
Thiago de Arruda dcda179e6a unittest: convert helpers.moon to lua 2014-08-31 14:50:49 +02:00
Thiago de Arruda 097ff4b8b2 unittest: convert garray_spec.moon to lua 2014-08-31 14:50:49 +02:00
Scott Prager b9553bd038 path.c: Learn invocation_path_tail().
Required for vim patch 276 as an alternative to
`get_isolated_shell_name()`.
2014-08-17 22:16:00 -04:00
Pavel Platto 1a361b629a os_fchown: enable 'change group' unittest on Travis-CI
Add section `before_install` in `.travis.yml` to create test group and
add current user to this group.
It is needed because by default user on Travis-CI belongs only to one
primary group derived from that user. So we have no alternative to
change group of the file.
2014-08-13 09:36:09 +03:00
Pavel Platto 64ea24bc17 os_fchown: add unit tests 2014-08-13 09:13:59 +03:00
Scott Prager c3b9f863ea Units: Move NULL, OK, and FAIL to helpers.moon. #982 2014-07-30 18:25:43 -04:00
Nicolas Hillegeer 974752c53b test/shell: add tests
- The calls to (partially) initialize logging
  need to go. Blocked on #981.
2014-07-27 14:00:45 -03:00
Nicolas Hillegeer 1cfc468e5c test/helpers: allow interning Pascal strings
os_system() returns a Pascal string, for example (it also NUL-terminates the
string, but that's neither here nor there).
2014-07-27 14:00:45 -03:00
Nicolas Hillegeer ad4c1e1954 test/formatc: improve standalone usage
Easier testing.
2014-07-27 14:00:44 -03:00
Nicolas Hillegeer 10479fd233 test/formatc: improve 'inline' function handling
Apple seems to define some functions as `inline` but not `static` in
headers. The ghetto parser wasn't unbelievably happy with this.
2014-07-27 14:00:44 -03:00
Wayne Rowcliffe 7a2ea275eb Add tests for buffer.c and fileio.c 2014-07-22 05:28:17 -05:00
Wayne Rowcliffe 9453b7230b Statically allocate NameBuff 2014-07-22 05:28:17 -05:00
Nicolas Hillegeer 06ca70b191 test/fs: move tests of path_full_dir_name to path
Move tests of path_full_dir_name to path_spec. It is only defined in path.h.
Not sure why this works most of the time (I can only trigger a failure when
running under lldb).

It's a more logical place to have the test as well.
2014-07-16 19:05:35 +02:00
Nicolas Hillegeer c376cf46bf test/helpers: add 'vim_init' helper
- Initializes some global variables.
- Necessary for the buffer tests in PR #904.
2014-07-16 19:05:35 +02:00
Nicolas Hillegeer 109c70dc60 test/preprocess: always declare EXTERN
Unit tests never need to declare globals, only access them. In the main code
base this is handled by including "vim.h". If a file wants to declare
globals (in the case of neovim that's only main.c), it #define's EXTERN and
includes "vim.h". Otherwise, a file just includes "vim.h" (that's the
majority case). Since we want to be able to run unit tests without including
"vim.h", we predefine "EXTERN" to mean extern. That way, we don't have to
include "vim.h".
2014-07-16 19:05:35 +02:00
Nicolas Hillegeer 6d0f9417ec profiling: add tests
Some functions are missing:

- profile_self
- profile_get_wait
- profile_set_wait
- profile_sub_wait
2014-07-16 17:12:35 +02:00
Pavel Platto 790d81582c tempfile.c: add tests 2014-07-14 21:14:40 +02:00
Pavel Platto 2dc69700ec Use default busted pattern for unittests #943
- Unittest should contain substring '_spec' in filename.
- This is the simplest way to use both lua and moonscript tests.
- This prevents running of non-test scripts from test folder.
2014-07-14 20:08:39 +02:00
Justin M. Keyes 0ceebc2c91 os_open: add unit tests 2014-07-14 09:05:52 -04:00
Stefan Hoffmann 4a22fb06b9 FileID: implement FileID struct
`FileID` should encapsulate `st_dev` and `st_ino`. It is a new abstraction
used to check if two files are the same. `FileID`s will be embeded inside
other struts like `buf_t` or `ff_visited_T`, where a full `FileInfo` would be
to big.
2014-06-27 13:59:28 +02:00
Will Stamper 5b3b3fd3ed spelling fixes #827 2014-06-12 20:26:35 -04:00
ZyX 70929f7e16 Add automatic generation of headers
- The 'stripdecls.py' script replaces declarations in all headers by includes to
  generated headers.
  `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'`
  was used for this.
- Add and integrate gendeclarations.lua into the build system to generate the
  required includes.
- Add -Wno-unused-function
- Made a bunch of old-style definitions ANSI

This adds a requirement: all type and structure definitions must be present
before INCLUDE_GENERATED_DECLARATIONS-protected include.

Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is
the only exception.
2014-06-02 11:04:17 -03:00
Eliseo Martínez 74b9396043 Introduce nvim namespace: Fix unit tests.
Point cimports to new locations.
2014-05-15 20:46:02 +02:00
Stefan Hoffmann aff9673076 implemented FileInfo struct
This struct is a wrapper around `uv_stat_t` to hide the stat information
inside `src/os/`.
The stat file attribute will be private after all refactorings concerning
file informations are done.
2014-05-09 15:49:33 +02:00
Thomas Wienecke d84fe0a1b0 Fix unit test cleanup of path_shorten_fname_if_possible. 2014-05-03 14:16:55 -04:00
John Szakmeister 7cb20fd1b0 Generate a lua module to help pass build-related settings.
This allows us to avoid hard-coding paths and using environment
variables to communicate key information to unit tests, which fits
with the overall goal of making sure that folks driving CMake directly
can continue to do out-of-tree builds.
2014-05-03 10:36:54 -04:00
Nicolas Hillegeer b737b27e6a garray: add unit tests for ga_concat_strings_sep 2014-04-29 09:29:10 -03:00
Nicolas Hillegeer ce9c49f222 garray: add unit tests
Only append_ga_line() was not tested because it relies on global vim state.
2014-04-29 09:29:10 -03:00
John 42efbfd2fd Test and refactor shorten_fname and shorten_fname1
Rename `shorten_fname` -> `path_shorten_fname`
Rename `shorten_fname1` -> `path_shorten_fname_if_possible`
2014-04-29 09:24:34 -03:00