Commit Graph
3573 Commits
Author SHA1 Message Date
Thiago de Arruda 353bb20ff7 build/test: setup functional tests using vroom 2014-08-09 15:10:56 -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
Nicolas Hillegeer 9e04e81ac7 test: no longer define ad-hoc C headers
With the improved cimport helper, we can just load what we want.
2014-04-28 16:17:25 -03:00
Nicolas Hillegeer d699ccfb0c test: fix the cimport method
This commit will hopefully allow the cimport method to be used just as one
would use #inclue <header.h> in C. It follows the following method:

1. create a pseudoheader file that #include's all the requested header files
2. runs the pseudoheader through the C preprocessor (it will try various
   compilers if available on the system).
3. runs the preprocessed file through a C formatter, which attempts to group
   statements on one line. For example, a struct definition that was
   formerly on several lines will take just one line after formatting. This
   is done so that unique declarations can be detected. Duplicates are thus
   easy to remove.
4. remove lines that are too complex for the LuaJIT C parser (such as:
   Objective-C block syntax, crazy enums defined on linux, ...)
5. remove duplicate declarations
6. pass result to ffi.cdef
2014-04-28 16:17:25 -03:00
Stefan Hoffmann 445f31f076 port vim_mkdir, mch_rmdir and mch_remove to libuv 2014-04-11 13:31:48 -03:00
John Schmidt 2a0c6ff3ef Fix broken build due to unit test include order
Commit 4348d1e6f7
 introduced a bug that breaks the unit tests unless
 they run in a certain order. Both path.moon
 and os/fs.moon tries to include the same Enum, which
 fails since ffi.cdef can only include definitions once.

 This solves the bug by using Lua variables instead of
 ffi.cdef Enums.
2014-04-09 17:17:26 -03:00
John Schmidt ac62041138 Move exe functions back to os/fs.c 2014-04-08 21:56:05 -03:00
John Schmidt 6fb58d1c5c Change prefix from os_* to path_* 2014-04-08 21:56:05 -03:00
John aa7218b646 Move and adapt os_get_absolute_path unit tests to vim_FullName
* Add two new unit tests to `vim_FullName`
* Make `os_get_absolute_path` static
2014-04-08 21:56:05 -03:00
John Schmidt 4348d1e6f7 Move functions from os/fs.c into path.c
Move unit tests from os/fs.moon to path.moon
2014-04-08 21:56:05 -03:00
Hinidu 8a2ffb2b01 Use stdbool in os module 2014-04-07 12:15:28 -03:00
Stefan Hoffmann e76249c813 Moved mch_get_host_name and renamed it to os_get_hostanme 2014-04-05 20:19:38 -03:00
Stefan Hoffmann a8013f2bb1 Moved mch_get_pid and renamed it to os_get_pid 2014-04-05 20:19:38 -03:00
Hinidu a3ff83ce7e Replace mch_rename and vim_rename with libuv 2014-04-04 16:03:55 -03:00
Thomas Wienecke bfa4490aac Rename FPC_* constants. 2014-04-03 10:32:41 -03:00
Thomas Wienecke 865e3280a8 Fix seperator->separator, path_tail_with_separator->path_tail_with_sep. 2014-04-03 10:32:41 -03:00
Thomas Wienecke 955d6a2949 Test and refactor getnextcomp -> path_next_component. 2014-04-03 10:32:41 -03:00
Thomas Wienecke 7021b970b9 Test and refactor gettail_sep -> path_tail_with_seperator. 2014-04-03 10:32:41 -03:00
Thomas Wienecke 77bfb6cd99 Test and refactor gettail -> path_tail. 2014-04-03 10:32:41 -03:00
Thomas Wienecke 6d712defa5 Refactor fullpathcmp -> path_full_compare. 2014-04-03 10:32:41 -03:00
Thomas Wienecke 98b1f73c3f Make FPC_* defines an enum type in path.h. 2014-04-03 10:32:41 -03:00
Stefan Hoffmann f762a9e195 move filewritable() into /src/os/fs.c and rename it 2014-04-03 10:30:03 -03:00
Stefan Hoffmann 071d28076f move check_file_readonly() into /src/os/fs.c and rename it 2014-04-03 10:30:03 -03:00
Thomas Wienecke f9d4b14f25 Delete os_delay unit test. 2014-04-02 18:50:09 -03:00
Thomas Wienecke 4e29a820b6 Address clint warnings and other style issues.
* Add const.
* Fix conditions (move && from end to start of line).
* Use int32_t instead of long.
* Use //-style comments.
2014-03-27 19:57:55 -03:00
Thomas Wienecke 5762c4e528 Rename mch_* functions to os_* in os module. 2014-03-27 19:57:55 -03:00
Stefan Hoffmann 7d413050ba fix mch_delay() unittest 2014-03-25 15:41:15 +01:00