Commit Graph

294 Commits

Author SHA1 Message Date
Rui Abreu Ferreira
9ce81f7b2b functionaltest: Create lua helper for os.tmpname()
In Windows Lua's os.tmpname() returns relative paths starting with \s,
prepend them with $TEMP to generate a valid path.

In OS X os.tmpname() returns paths in '/tmp' but they should be in
'/private/tmp'. We cannot use os_name() for platform detection because
some tests use tempname() before nvim is spawned, instead use one of the
following:

1. Set SYSTEM_NAME environment variable before calling the tests, it
   is set from CMAKE_SYSTEM_NAME(i.e. uname -s or 'Windows')
2. Call uname -s
3. Assume windows
2016-08-31 11:32:28 +01:00
Tommy Allen
966f1abd8b tests: Set env variables in RunTests.cmake
- NVIM_RPLUGIN_MANIFEST
- XDG_CONFIG_HOME
- XDG_DATA_HOME
2016-08-17 16:22:21 -04:00
Rui Abreu Ferreira
db7fdcd0ba MSVC: Build third-party dependencies as release DLLs
Using /MT was causing issues when building luarocks, revert it, use the
dynammic runtime and generate release DLLs for the dependencies.
Some refactoring was required because for linking cmake looks for the
import libraries (.lib) but on runtime executables we need the .dll files
to be in the same folder.

The DLLs are placed in the bin/ folder in order for nvim.exe to run
during the build and tests. The install target installs the DLLs with
the nvim binary - uses GetPrerequisites to find runtime DLLs.

Some minor issues that required adjustments:
- [MSVC] FindMsgpack.cmake now looks for msgpack_import.lib instead of
  msgpack.lib
- The lua-client fails to find libuv.lib, instead it looks for uv.lib,
  added second copy of the file to the install command.
- [MSVC] CMAKE_BUILD_TYPE affects the output paths, default to Release.

Part of these changes are credited to @jasonwilliams200OK who fixed the
third-party recipes to consistently use the same build type.
2016-08-07 21:57:28 +01:00
Josh Triplett
fc98d2d96d Pass busted the path to the detected Lua interpreter
Otherwise, busted may run a different interpreter than the one we
detected, without the capabilities we expect.  (For instance, we might
have detected the luajit interpreter, but busted might run the lua
interpreter, without the ffi module.)
2016-07-13 00:37:50 -07:00
Rui Abreu Ferreira
d5c89b1896 cmake: Allow building without Luajit
By default Neovim searched a Luajit instalation and linked against
the luajit library.

In practice Neovim only requires luajit to run the unit tests. All other
targets only require lua and the correct lua modules. This commit:

1. Remove the strict dependency on Luajit
2. Makes the unittest target depend on the lua 'ffi' module.
   If the module is not available the target is not enabled
   and a message is displayed.
2016-05-19 17:55:19 +01:00
KillTheMule
360d0513d1 Satisfy testlint.
For that, make luatest ignore the preload.lua files.
2016-04-28 19:30:17 +02:00
Björn Linse
5c1597cad1 cmake: allow linting a specific file
For instance to only lint "edit.c"
make lint LINT_FILE="src/nvim/edit.c"
2016-02-25 11:31:34 +01:00
James McCoy
1d1574e0ac cmake: Use find_package(Msgpack)'s version in pkg_search_module
Avoid duplicating information by using the Msgpack_FIND_VERSION variable
exported by find_package() inside FindMsgpack's pkg_search_module call.
2016-02-05 21:23:19 -05:00
James McCoy
79e7c03f91 cmake: msgpack: Check all lib names per directory
By default, find_library() searches all directories for one possible
name and then looks for the next name.  To make sure we're building
against the same headers and libraries, look for all names in a
directory before moving to the next one.
2016-02-05 19:46:53 -05:00
James McCoy
2be51f5e85 cmake: msgpack: Add more thorough version check
In 33bc332, version constraints were added to pkg_search_module(), but
that only affects the set of directories searched by
find_library()/find_path().

Once the header directory is found, parse the version from
version_master.h so it can be checked by the find_package() call in the
root CMakeLists.txt.
2016-02-05 19:46:53 -05:00
James McCoy
33bc33274a cmake: msgpack: Ensure at least version 1.0 is found
Neovim's code relies on functionality introduced in msgpack-c 1.0.0
(at least MSGPACK_OBJECT_FLOAT enum value), so enforce that minimum
version.
2016-01-28 09:01:05 -05:00
James McCoy
feb70192a8 cmake: Search for both libmsgpackc and libmsgpack #4075
libmsgpack was the old C++ library provided by msgpack-c.  The C library
is libmsgpackc.

The C++ support became header-only, but there was a bug
(msgpack/msgpack-c#395) wherein using msgpack-c's CMake build system
would only install libmsgpack instead of libmsgpackc.

Searching for both libraries, but preferring libmsgpackc, allows for
building against older msgpack-c releases and prepares for the upcoming
msgpack-c release which fixes the aforementioned issues.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-01-22 23:03:14 +01:00
Rui Abreu Ferreira
655f1b7513 MinGW: Add libluajit-5.1 lib name to FindLuaJit 2015-12-02 23:07:22 -05:00
Rui Abreu Ferreira
f22dfeb00d cmake: Don't use check_library_exists for Win32 API libraries
When building for X86 the CMake check_library_exists always fails to find
functions from the Win32 API due to name mangling conventions. The convention
for API functions is __stdcall and the CMake test code assumes __cdecl. Since
these are libraries from the Windows API we can simply link against the
libraries without checking for the functions.
2015-11-29 23:48:01 -05:00
Marco Hinz
818f926eb0 Tests: add luacheck for linting tests
Source: https://github.com/mpeterv/luacheck
Docs:   http://luacheck.readthedocs.org/en/0.12.0/index.html

Run via "make testlint".
2015-11-23 13:57:21 +01:00
Michael Reed
2fbcc9ab76 Be more explicit about the lack of X11 integration
I don't want anyone getting the idea that the `-X` flag they might have
used has anything to do with why the `+` is working for them
2015-11-10 20:10:55 -05:00
Florian Walch
90909e9362 CMake: Force use of project directory to look for Git data.
Before this change, building Neovim would recursively search parent
directories for a .git directory. If Neovim was downloaded as a tarball
(i.e. without a .git directory), but placed in a subdirectory of
a Git repository, this caused a CMake error. Such a situation could
occur when packaging Neovim, for example.

Unfortunately, the previous attempt in #3317 did not fix this problem.
2015-11-01 16:19:52 +01:00
Rui Abreu Ferreira
b50cc42eb7 Windows: Link against libraries libuv needs on Windows. 2015-09-09 17:44:22 -04:00
Rui Abreu Ferreira
73db02b99c MSCV: FindLibUV: fix libname. #3261 2015-08-31 03:18:04 -04:00
Rui Abreu Ferreira
d00d37b486 Windows: FindLuaJit: fix libname. #3262 2015-08-31 03:16:35 -04:00
ZyX
57eaefbb23 ci: Use error suppression in place of ignored files list. #3185
Fixes #3174
2015-08-20 23:40:15 -04:00
Florian Walch
d2eb4a9346 Travis: Refactor CI files, use container infrastructure.
* Split build steps to utilize the Travis build lifecycle.
 * Move shell code from `.travis.yml` into Bash files in `.ci/`,
   one file for each step of the Travis build lifecycle.
 * Use configuration variables in `.travis.yml` to change
   build behavior (e.g. build 32-bit with `BUILD_32BIT=ON`).
 * Keep all configuration in environment variables in
   `.travis.yml`. In scripts, concatenate environment variables
   according to configuration to change to different behavior.
 * Add GCC 5 builds for Linux.
 * Use Travis's caching feature [1] for third-party dependencies
   and pip packages.
 * Allow failures MSan, as the errors it reports have to be
   fixed first.

Valgrind is still disabled, but can be enabled by setting
`env: VALGRIND=ON` for a job in `.travis.yml`.

[1] http://docs.travis-ci.com/user/caching
2015-07-08 07:42:16 -03:00
Michael Reed
3c2fa1767b cmake: Make make lint less verbose
It unnecessarily complicates spotting linter errors, as they're usually
surrounded by a bunch of lines saying "Done processing ... ".
2015-06-27 15:21:09 -04:00
Thomas Anderson
9995f15a98 CMake: Fix helptags generation when prefix is not /usr. #2741 2015-06-09 01:12:08 -04:00
Florian Walch
6609a545ad CMake: Workaround for hanging helptags generation. #2801
Piping input into nvim causes the helptags generation to hang. For
example, the following does not work:

    yes | nvim -c "helptags ."

The helptags are generated during installation with a command similar
to the one above, using CMake's execute_process to call nvim.
As execute_process does not use an intermediate shell, the following
will cause the installation to hang:

    yes | make install

pacaur, an Arch Linux package helper, uses a similar command to
install packages [1], and thus can currently not be used to install
Neovim.

This commit adds a workaround to GenerateHelptags.cmake to circumvent
this problem.

[1] 22c00a3d05/pacaur (L825)
2015-06-06 14:29:33 +03:00
Michael Reed
aa1d9a1807 Build: Use GNUInstallDirs, install man pages #2649
For now, only install man pages matching "nvim*.1": we don't want to
install xxd.1 as it might conflict with that of a user's Vim
installation.

closes #1826

Reviewed-by: Florian Walch <florian@fwalch.com>
Helped-by: John Szakmeister <john@szakmeister.net>
2015-05-17 14:57:43 -04:00
Rui Abreu Ferreira
f65614fb1c Travis: Add Mingw third-party builds
- Build third-party/ in Travis using mingw
- Import mingw-w64 cmake toolchain
2015-05-15 17:55:02 +03:00
Florian Walch
2446b997c6 CMake: Remove duplicate PkgConfig lookups. 2015-04-29 22:26:55 +03:00
Florian Walch
07d4142a18 CMake: Refer to Unibilium instead of LibUnibilium. 2015-04-29 22:26:55 +03:00
Thiago de Arruda
0487ea9f64 build: Improve GenerateHelptags.cmake failure message
Some errors during helptags can be caused by duplicate/wrong tags after
documentation cleanup. Suggest the removal of the "doc" directory.
2015-04-13 12:29:54 -03:00
Thiago de Arruda
8a1a9b9558 deps: Add jemalloc as an optional dependency
Jemalloc will be used if the cmake option `USE_JEMALLOC` is enabled(which is the
default). To avoid trouble with clang's ASAN, it is disabled by default if the
`SANITIZE` option is enabled.

Since jemalloc has thread cache for small objects, it fills the gap created by
removing klib memory pools.

The `xstrdup` funciton(memory.c) had to be reimplemented on top of `xmalloc` to
make it work with a custom allocator.
2015-04-13 08:22:59 -03:00
Thiago de Arruda
1ee7ca7bc0 test: Improve functional test debuggability and efficiency
- Read TEST_TAG/TEST_FILTER env vars from cmake/RunTests.cmake. Setting these
  environment variables will pass --tags/--filter to busted, which can used to
  filter which tests are executed.
- Remove calls to nvim msgpack-rpc API outside tests. This removes the
  requirement of having a static `clear` call in test/functional/helpers.lua
- Use the new busted command-line option "--lazy" to ensure the setup/teardown
  hooks are only executed when a suite runs at least one test.

Now its possible to run/debug a single test like this:

```sh
TEST_FILTER='some test string' make test
```

Which will only run tests containing "some test string" in the title.
Another option is:

```sh
TEST_TAG=some-tag make test
```

After putting #some-tag into the test title. This also improves debugging
experience because there will be no unnecessary gdbserver instances whe GDB=1 is
passed.
2015-03-24 12:46:15 -03:00
John Szakmeister
afae3e25d5 build: add support for running the tests in junit format
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.
2015-03-21 09:47:49 -04:00
John Szakmeister
d8ef23849a tests: prevent busted from reloading the ffi module and others
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.
2015-03-01 15:25:39 -05:00
Thiago de Arruda
81a346553c deps: Add libvterm to the project dependencies
libvterm is a terminal emulation library with abstract display. It will be used
to implement builtin terminal emulation into Nvim.
2015-02-28 10:41:53 -03:00
John Szakmeister
e077f4ee99 build: filter off libuv from PC_LIBUV_LIBRARIES
Otherwise, the -rdynamic that is being passed on the command line will
require a dynamic link, even though we often want a static one.
2015-02-24 14:01:25 -05:00
Thiago de Arruda
9e75b2e18b deps: Remove libtickit as a project dependency
Also update libtermkey version and fix the pkg-config search scripts.
2015-02-11 12:40:50 -03:00
Florian Walch
281cd3856c CMake: Hide stderr output for successful test runs.
Fixes #1301.
2015-02-06 13:39:23 +01:00
Florian Walch
e21f6e754d Linting: Integrate into CMake, enable by default. 2014-12-24 00:32:26 -05:00
John Szakmeister
cf1939aab3 build: only manipulate out if getting the timestamp was successful
This fixes an issue seen in #1548, though the real problem is something
different.
2014-12-03 04:56:50 -05:00
John Szakmeister
143833872b build: no need to quote the paths in CMake, it will do it automatically 2014-12-03 04:54:21 -05:00
John Szakmeister
279c519e33 build: fix a typo in a comment of FindLuaJit.cmake 2014-12-02 18:44:15 -05:00
Thiago de Arruda
9ac2e8423a deps: Add libtickit/libtermkey as dependency
The new terminal UI will be implemented on top of those libraries
2014-12-01 20:36:37 -03:00
Steven Oliver
80cda3f2fb build: add failure message along with number in GenerateHelptags.cmake 2014-11-25 19:31:11 -05:00
John Szakmeister
346e07e8da build: print the error result when the tests fail
Any diagnostic information is useful when things fail.  In my case, it
printed out the fact that the tests were segfaulting.
2014-11-25 06:15:57 -05:00
John Szakmeister
369045cf05 Fix #1484: search gettext subdir for header
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.
2014-11-17 19:31:48 -05:00
John Szakmeister
6e87557c08 build: allow installing into the root directory (/)
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.
2014-11-09 17:48:19 -05:00
Florian Walch
176930fa56 version: Add compilation info. 2014-11-09 18:34:57 +01:00
John Szakmeister
dcccc1a50d Merge pull request #1437 from jszakmeister/build-search-fixes
A few fixes for some build-related issues.
2014-11-09 08:31:33 -05:00
John Szakmeister
1ea90f6971 Merge pull request #1400 from jszakmeister/install-helpers-destdir
build: fix the usage of DESTDIR in InstallHelpers.cmake
2014-11-09 05:03:05 -05:00
John Szakmeister
938faf5e2d build: fix the usage of DESTDIR in InstallHelpers.cmake
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.
2014-11-08 16:55:15 -05:00
John Szakmeister
9344a40e74 build: pull iconv detection into its own FindIconv.cmake file
This will provide better control for those who may want to alter which
one gets used.
2014-11-08 16:22:35 -05:00
Thiago de Arruda
5e5525a78b test: Set VIMRUNTIME before running tests
This is required for testing scripts under the 'runtime' directory
2014-11-05 14:02:04 -03:00
Florian Walch
afa5831d73 CMake: Fix running individual (functional/unit) test. 2014-11-05 13:57:29 +01:00
John Szakmeister
5ba1d980fb build: fix running of functional tests directly with CMake
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.
2014-11-05 07:26:35 -05:00
Florian Walch
cc7199f0e5 CMake: Fix helptags generation. 2014-11-03 19:46:40 +01:00
Florian Walch
3fa28d2ba5 Revert "Merge pull request #1381 from xzfc/master"
This reverts commit 6c0a596dac, reversing
changes made to 33d3a7c83b.
2014-11-03 18:07:56 +01:00
Albert Safin
37be21fdee GenerateHelptags: Use ${PREFIX} variable 2014-11-03 19:06:59 +06:00
Albert Safin
62ede403f0 CMake: Fix checking of DESTDIR 2014-11-03 19:05:46 +06:00
Xu Cheng
973fc5c66b GenerateHelptags: check whether DESTDIR exists 2014-11-03 14:41:49 +08:00
Florian Walch
0b775e3513 CMake: Set execute permissions during installation. 2014-10-20 15:07:14 +02:00
Thiago de Arruda
69561ea922 test: Remove run-functional-tests.py
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.
2014-10-16 09:21:37 -03:00
Justin M. Keyes
92b17e174f cmake: handle missing git or .git/
GetGitRevisionDescription.cmake: we don't need fine-grained failure
modes, we only need "yes" or "no".

fix #1292
2014-10-15 14:45:42 -04:00
Xu Cheng
7e57d326f4 homebrew: look for .git/ outside of build workspace #1274 2014-10-15 14:45:38 -04:00
Justin M. Keyes
a1901941f8 version: generate "build number" from commit timestamp
- 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
2014-10-07 10:23:15 +00:00
Justin M. Keyes
2c2fee4d1f version: report commit hash as "build number" in long version string 2014-10-07 10:03:14 +00:00
Thiago de Arruda
549fc9548d test: Move 'test/legacy' to 'test/functional'
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'.
2014-10-01 09:05:28 -03:00
Thiago de Arruda
42d5b526b9 test: Replace vroom by lua/busted for functional tests
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
2014-09-30 17:37:16 -03:00
John Szakmeister
0d35369324 build: install with the correct permissions
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.
2014-09-22 05:56:52 -04:00
Thiago de Arruda
e2143674ae deps: Update to the experimental msgpack v5 branch
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
2014-09-12 13:19:50 -03:00
Florian Walch
0a01b3052e Update busted to 2.0.rc3.
Default to verbose output to show more information in case of errors.
Fix #1031.
2014-09-11 20:03:35 +02:00
Florian Walch
bbaf699b6b CMake: Use DESTDIR for helptags generation. 2014-08-23 18:05:41 -04:00
Florian Walch
1310820e4f CMake: Generate helptags during install step.
Fix #1056.
2014-08-23 09:32:47 -04:00
John Szakmeister
531ded7865 Move po generation from Make to CMake.
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.
2014-07-17 07:16:53 -04:00
John Szakmeister
c261b351ed Revert "Merge #928 'Move po gen to cmake'"
This reverts commit 53fba180c3, reversing
changes made to a3b3db8256.
2014-07-17 06:10:38 -04:00
John Szakmeister
67533e0948 Move po generation from Make to CMake.
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.
2014-07-17 05:47:32 -04:00
Rui Abreu Ferreira
feffc65270 Add cmake platform checks
- 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
2014-07-15 10:43:21 +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
Rui Abreu Ferreira
6f0d3c0e77 Refactor the lua dependency checking.
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>
2014-07-11 19:28:54 -04:00
Rui Abreu Ferreira
e06595fffb Removed unnecessary PATHS from cmake modules
- DEPS_INSTALL_DIR is already set into CMAKE_PREFIX_PATH in
  the main CMakeLists.txt
2014-07-08 05:06:09 -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
John Szakmeister
f9885f0b6a Allow a single unittest file to be run.
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
2014-04-23 07:11:59 -04:00
Thiago de Arruda
9f7426ca16 Configure travis to perform a 32-bit build
- Build targeting 32-bit with travis
- Code in `before_install`/`after_success` was moved to travis.sh since it
  provides greater flexibility for detecting the build matrix environment. This
  improves the build speed since we now install only what's necessary.
- Now clint has a dedicated travis worker
2014-04-22 21:55:59 -03:00
Thiago de Arruda
78fd9386b6 Fix unit tests
Apparently busted 1.11.0 is broken(https://github.com/Olivine-Labs/busted/issues/236)
in a way that is causing the unit tests to fail. This pins the version to 1.10.0
and also fixes a wrong variable set when msgpack was added as a dependency
2014-04-14 16:46:16 -03:00
Thiago de Arruda
878e6e661d Add cmake module for finding msgpack 2014-04-11 14:07:44 -03:00
John Szakmeister
0efc815216 Append to CMAKE_PREFIX_PATH instead setting it outright.
Also, don't set it in the FindXxx cmake scripts--it's unnecessary, and
it resets the value.
2014-03-28 05:09:45 -04:00
John Szakmeister
f9aeb219c1 Fail RunUnittests if we get a non-zero exit code from busted. 2014-03-25 13:10:26 -04:00
John Szakmeister
1eed86883b Deal with the missing dependencies for libuv.
Since libuv.pc is broken at the moment, try to determine libuv's
dependencies ourselves.  This ports most of the checks from libuv into
our CMake build, and fixes the build on other unix platforms.
2014-03-21 15:22:00 -04:00
John Szakmeister
0b2f6a0cf4 Revamp the build system.
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.
2014-03-21 15:22:00 -04:00
Alexis Hildebrandt
05b9e11584 CMakeLists: Improve handling of libintl
by refactoring it into a separate CMake module
2014-02-27 19:11:48 +00:00
Rich Wareham
970be6d977 CMake: add LibUV_USE_STATIC configuration variable
If LibUV_USE_STATIC is set then the static libuv library will be
preferred to the shared library. This is useful when building with the
bundled libuv but is less useful when building with a system libuv.
2014-02-26 17:36:06 +00:00
Rich Wareham
c3ff8cbb7c prefer linking to static libuv
Explicitly try to find the static libuv library first.

This might be considered a hack and if it weren't a single-use module it
might be preferable to control static versus shared preferences with a
configuration variable.
2014-02-26 07:09:11 -03:00
Rich Wareham
00ca93fb50 automatically discover libuv in CMake
Idiomatically discover if libuv is installed.
2014-02-26 07:08:44 -03:00
Rich Wareham
e10290c3ea add LibFindMacros CMake macro library 2014-02-26 07:08:26 -03:00