Commit Graph

9 Commits

Author SHA1 Message Date
Tobias Hunger d792491c40 cmake-server: Better error reporting during handshake
Catch more problematic input during handshake and report failure.

These were caught before when trying to configure, but it is way better
to get these reports early.
2016-10-27 14:18:42 -04:00
Brad King 9b8dc79cc8 cmake-server: Change message wrapper to avoid ambiguity with content
Change our message wrapper from

    [== CMake Server ==[ ... ]== CMake Server ==]

to

    [== "CMake Server" ==[ ... ]== "CMake Server" ==]

to guarantee that no JSON content can ever contain the ending string
(because it would be encoded as `]== \"CMake Server\" ==]`).
2016-10-24 14:36:13 -04:00
Brad King d56f9237d7 Tests: Teach Server test to wait for server exit
We expect the server to exit when its communication pipes are closed.
Close them and wait for the server to exit.  If supported by the current
version of python, kill the server if it does not exit after a few
seconds.
2016-09-30 09:36:57 -04:00
Tobias Hunger 71a505870c server-mode: Add project data for unit tests
Do some basic unit tests for "codemodel", "cmakeInputs" and "cache"
commands of the cmake server.

This just calls the commands right now and makes sure the server
thinks it can reply to the request. The data itself is currently not
validated.
2016-09-28 20:10:59 +02:00
Tobias Hunger 544f65f44d server-mode: Set global configuration of cmake via a command
"setGlobalSettings" can be used to change settings reported by
"globalSettings" command.
2016-09-26 14:25:20 -04:00
Tobias Hunger 82104cc7a8 server-mode: Query global configuration of cmake via a command
Add "globalSettings" command that returns:
* Return capability information
* Return currently used generator/extra generator
* Return a range of flags for debug/trace/etc.
2016-09-26 14:23:53 -04:00
Tobias Hunger 1d601c6cb9 server-mode: Introduce cmServerConnection
Use it to split pipe and stdin/out handling out of cmServer itself.

The server will shut down when it looses its connection to the client.
This has the nice property that a crashing client will cause the server
to terminate as the OS will close the connection on behave of the client.
2016-09-22 08:06:38 -04:00
Tobias Hunger 7df8a8f276 server-mode: Add --experimental flag
Allow for experimental cmProtocolVersions, which will only ever get
listed if the server was started with the (undocumented)
"--experimental" flag.

Mark current protocol version 1.0 as experimental.
2016-09-20 08:32:26 -04:00
Tobias Hunger b63c1f6ce7 cmake-server: Add unit test 2016-09-19 08:57:58 -04:00