From 2f730efd41ba7a663de9f9743b16544d65c657a3 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Fri, 17 Mar 2017 16:45:10 -0700 Subject: [PATCH] add doctest --- .gitmodules | 3 +++ command_line.cc | 15 ++++++++++++++- third_party/doctest | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 160000 third_party/doctest 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