1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 06:57:35 +00:00

LanguageServer/Cpp: Add tests

The Cpp LanguageServer tests can be run with: CppLanguageServer -t

The tests now only cover some very simple autocomplete and
"find declaration" use cases, but it's a start :)
This commit is contained in:
Itamar 2021-05-12 20:36:00 +03:00 committed by Andreas Kling
parent e9fc5d6cc3
commit 6329e9fce6
4 changed files with 165 additions and 1 deletions

View file

@ -5,7 +5,9 @@
*/
#include "ClientConnection.h"
#include "Tests.h"
#include <AK/LexicalPath.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
#include <LibCore/File.h>
#include <LibCore/LocalServer.h>
@ -13,7 +15,24 @@
#include <sys/stat.h>
#include <unistd.h>
int main(int, char**)
static int mode_server();
int main(int argc, char** argv)
{
bool tests = false;
Core::ArgsParser parser;
parser.add_option(tests, "Run tests", "tests", 't');
parser.parse(argc, argv);
if (tests) {
return run_tests();
}
return mode_server();
}
int mode_server()
{
Core::EventLoop event_loop;
if (pledge("stdio unix recvfd rpath ", nullptr) < 0) {