add doctest

This commit is contained in:
Jacob Dufault 2017-03-17 16:45:10 -07:00
parent ada13f2939
commit 2f730efd41
3 changed files with 18 additions and 1 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "third_party/tiny-process-library"]
path = third_party/tiny-process-library
url = https://github.com/eidheim/tiny-process-library/
[submodule "third_party/doctest"]
path = third_party/doctest
url = https://github.com/onqtam/doctest

View File

@ -13,6 +13,9 @@
#include "third_party/tiny-process-library/process.hpp"
#define DOCTEST_CONFIG_IMPLEMENT
#include "third_party/doctest/doctest/doctest.h"
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/ostreamwrapper.h>
@ -1023,6 +1026,10 @@ void PreMain() {
MessageRegistry::instance()->Register<In_WorkspaceSymbolRequest>();
}
TEST_CASE("helo") {
CHECK(1 == 1);
}
int main(int argc, char** argv) {
bool loop = false;
while (loop)
@ -1035,7 +1042,13 @@ int main(int argc, char** argv) {
// return 0;
//}
if (argc == 1) {
RunTests();
doctest::Context context;
context.applyCommandLine(argc, argv);
int res = context.run();
if (context.shouldExit())
return res;
//RunTests();
return 0;
}

1
third_party/doctest vendored Submodule

@ -0,0 +1 @@
Subproject commit 11147357234d0166c9ec96c4d9e328464b884da3