This requires a couple of extra modules that are not installed by
default, and it requires capturing stdout of the tests--otherwise CMake
output is intermixed with the XML output of busted.
It turns out that Busted started cleaning the environment in 2.0rc5 as a
result of Olivine-Labs/busted#62. This, in turn, caused the ffi module
to be reloaded for each spec file, and LuaJIT doesn't appreciate it.
The net effect is an assertion error in LuaJIT.
By using the --helper feature of Busted, we can pre-load some modules
ahead of Busted and prevent it from reloading them--making LuaJIT happy
again.
On some systems, such as NetBSD, the gettext header is tucked under the
gettext directory in the system include area. Let's add a path suffix
to ensure we correctly discover the header on such systems.
It turns out that CMake always canonicalizes `CMAKE_INSTALL_PREFIX` to
an absolute path--if it's a relative path, it canonicalizes it relative
to the build directory. As a result, the only thing the DESTDIR and
relative directory check prevents is an installation into the root
directory since CMake strips the trailing slash, turning "/" into an
empty string. Let's just remove the check all together, since it cannot
accomplish what we intended.
It turns out that `file(INSTALL ...)` already accounts for `DESTDIR`, so
this wasn't creating the directory structure in the correct location.
Instead, we need to do our existence check with `DESTDIR`, but leave it
off when doing the install step.
While we're at it, add a check to make sure `ENV{DESTDIR}` is not being
used with a relative path, as that construct doesn't make much sense.
This fixes issue #1387 discovered while trying to make helptag
generation work correctly in #1381.
If you aren't just building everything into build/, then the functional
tests fail because they can't find the nvim executable. Let's pass in
the location of the nvim executable, and set NVIM_PRG environment
variable accordingly.
Now that the lua client is available, python/lupa are no longer necessary to run
the functional tests. The helper functions previously defined in
run-functional-tests.py were adapted to test/functional/helpers.lua.
- cmake: git_timestamp() returns last commit time formatted as
`YYYYMMddHHmm`.
- Always include commit hash in :version and --version output.
`nvim --version` sample output:
NVIM 0.0.0-alpha+201410070245 (compiled Oct 7 2014 05:30:45)
Commit: f747b2b1ff7bfe7eb00cc2be82d7af87c98f1111
Busted can only discover tests from a single directory. In order to allow tests
under 'legacy' to run as a functional test, it needed to be moved to
'test/functional'.
The 'lupa' python package provides a simple way to seamless integrate lua and
python code.
This commit replaces vroom by a python script that exposes the 'neovim' package
to a lua state, and invokes busted to run functional tests. This is a temporary
solution that will enable writing functional tests using lua/bused while a lua
client library is not available.
The reason for dropping vroom is flexibility: Lua/busted has a nice DSL-style
syntax while also providing the customization power of a full programming
language. Another reason is to use a single framework for unit/functional tests.
Two other changes were performed in this commit:
- Instead of "gcc-unittest/gcc-ia32", the travis builds for gcc are now
identified by "gcc/gcc-32". They will run unit/functional tests for both 64
and 32 bits.
- Old integration tests(in src/nvim/testdir) are now ran by the 'oldtest' target
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes#1201 and #1086.
Using msgpack v5 will let nvim be more compatible with msgpack libraries for
other platforms.
This also replaces "raw" references by "bin" which is the new name for msgpack
binary data type
Fixes#902: localization build: `install`, `uninstall`, `prefixcheck
targets. All the language-related bits will now build under CMake.
Changes include:
* Moving all non-generated sources into the NEOVIM_SOURCES variable
to aid in generating the .pot file.
* Moving a couple generated sources from NEOVIM_SOURCES and into
NEOVIM_GENERATED_SOURCES.
* Added NEOVIM_HEADERS to the executable and the library for folks who
are using something other than Ninja or makefiles (that way the
headers will show up in the IDE files).
* Now uses gettext's `--update` switch to update the .po files, rather
than doing a fragile `mv` dance that could leave you with a broken
working tree if you press CTRL-C at the right time.
* Creates `update-po-${LANG}` targets for updating individual
languages, just like the original Makefile.
* Also adds the `update-po` target for updating all the languages.
* Ported the `check-${LANG}` style targets. They're
`check-po-${LANG}` under CMake.
* Handles all the one-off instances that were in the original
Makefile. Fixed up ko.UTF-8.po to include the "Original
translation" line like other .po files to make the generation of the
"Generate from ..." comments consistent. Updated ko.po with the new
text.
Fixes#902: localization build: `install`, `uninstall`, `prefixcheck
targets. All the language-related bits will now build under CMake.
Changes include:
* Moving all non-generated sources into the NEOVIM_SOURCES variable
to aid in generating the .pot file.
* Moving a couple generated sources from NEOVIM_SOURCES and into
NEOVIM_GENERATED_SOURCES.
* Added NEOVIM_HEADERS to the executable and the library for folks who
are using something other than Ninja or makefiles (that way the
headers will show up in the IDE files).
* Now uses gettext's `--update` switch to update the .po files, rather
than doing a fragile `mv` dance that could leave you with a broken
working tree if you press CTRL-C at the right time.
* Creates `update-po-${LANG}` targets for updating individual
languages, just like the original Makefile.
* Also adds the `update-po` target for updating all the languages.
* Ported the `check-${LANG}` style targets. They're
`check-po-${LANG}` under CMake.
* Handles all the one-off instances that were in the original
Makefile. Fixed up ko.UTF-8.po to include the "Original
translation" line like other .po files to make the generation of the
"Generate from ..." comments consistent. Updated ko.po with the new
text.
- Defined CMake checks for all headers in config.h.in
- Removed headers checks that are not used anymore:
sgtty.h sys/statfs.h libintl.h poll.h
- Added UNIX check
- Add some fatal checks
+ Check for setenv() and fail if it does not exist
since our os layer just assumes it does
+ lstat is required by os_unix.c
+ sys/wait.h is required in UNIX
- Removed entries for functions that are not being used: getcwd,
getrlimit, getwd, nanosleep, sigaltstack, getwd, sigstack, fseeko
- Replaced nearly all defines in config.h.in for functions with
compile time checks
- Add check for symbol FD_CLOEXEC
- Add check for langinfo CODESET
- HAVE_ICONV_H and HAVE_ICONV hold the expected checks but Neovim uses
USE_ICONV define to actually decide whether to enable it
- Removed checks that are no longer needed
+ USEMEMMOVE
+ _FILE_OFFSET_BITS
+ HAVE_ST_BLKSIZE
+ dlfcn.h
- 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.
This is in preparation for the next step, which is to find a suitable
lua interpreter, rather than just erroring when an interpreter is found
but doesn't have the necessary dependencies.
Helped-by: John Szakmeister <john@szakmeister.net>
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.
With this, you can now run a single unit test file using:
TEST_FILE=/path/to/file make unittest
For example, to just run the path unit tests, you can do:
TEST_FILE=test/unit/path.moon make unittest