| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
|
|
|
|
| |
Some functions are missing:
- profile_self
- profile_get_wait
- profile_set_wait
- profile_sub_wait
|
| |
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
| |
Point cimports to new locations.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Only append_ga_line() was not tested because it relies on global vim state.
|
|
|
|
|
| |
Rename `shorten_fname` -> `path_shorten_fname`
Rename `shorten_fname1` -> `path_shorten_fname_if_possible`
|
|
|
|
| |
With the improved cimport helper, we can just load what we want.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 4348d1e6f74a87af55c6c01e7a0cb292e9dec114
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.
|
| |
|
| |
|
|
|
|
|
| |
* Add two new unit tests to `vim_FullName`
* Make `os_get_absolute_path` static
|
|
|
|
| |
Move unit tests from os/fs.moon to path.moon
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* Add const.
* Fix conditions (move && from end to start of line).
* Use int32_t instead of long.
* Use //-style comments.
|
| |
|
| |
|
|
|
|
|
| |
Needed to temporarily move two static variables from os_unix.c to 'globals.h'
as those are shared by other functions still in os_unix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This achieves several goals:
* Less reliance on scripts so we have better portability to Windows
(though we still have a ways to go for proper Windows support).
Luajit, luarocks, moonscript, and busted are all installed via CMake
now.
* Trying to make use of pkg-config to get the correct libraries. The
latest libuv is still broken in this regard, but we'll at least be in
a position to use it.
* Allow the use of Ninja or make. The former runs faster in many
environments, and automatically makes use of parallel builds.
This also allows for system installed dependencies--though not through
the Makefile just yet--and adds support for FreeBSD.
This also make us build libuv and luajit as static libraries only, since
we're only concerned about having static libraries for our bundled
dependencies.
|
|
|
|
|
|
| |
* Move vim_fname from misc1 to os/fs:os_file_exists.
* Add unit tests for os_file_exists.
* Replace misuse of mch_getperm with os_file_exists.
|
|
|
|
|
| |
Use preprocessor trick proposed by @mahkoh to import 'defines' like
S_IRUSR.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* Add const specifiers, update comments, add assert.
* Move os_unix.moon tests to os/fs.moon + clean tests.
* Add uv_fs_req_cleanup call.
* Add tests with absolute paths to mch_isdir.
* Add to_cstr to test/unit/helpers.moon and fix respective unit tests.
|
|
|
|
|
|
| |
Testing the public interface mch_can_exe should suffice. Every former
test of is_executable has a counterpart in the tests of mch_can_exe.
Thus we can keep private things private.
|
|
|
|
| |
* Rename executable_file to is_executable.
|