diff --git a/.gitmodules b/.gitmodules index 787770b6..3fee5dd3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/command_line.cc b/command_line.cc index 192e8fe0..2b80efa3 100644 --- a/command_line.cc +++ b/command_line.cc @@ -13,6 +13,9 @@ #include "third_party/tiny-process-library/process.hpp" +#define DOCTEST_CONFIG_IMPLEMENT +#include "third_party/doctest/doctest/doctest.h" + #include #include @@ -1023,6 +1026,10 @@ void PreMain() { MessageRegistry::instance()->Register(); } +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; } diff --git a/third_party/doctest b/third_party/doctest new file mode 160000 index 00000000..11147357 --- /dev/null +++ b/third_party/doctest @@ -0,0 +1 @@ +Subproject commit 11147357234d0166c9ec96c4d9e328464b884da3