Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tools/CheckMain.cpp
diff options
context:
space:
mode:
authorLeitwolf2026-11-02 00:51:11 +0300
committerGitHub2026-11-02 00:51:11 +0300
commit268698be92962247a21a86dda4de2d4267adcf8f (patch)
tree510f7ece1750b2da6d9b4666b7c58908c8d193bb /tools/CheckMain.cpp
parent13324a043042110eba456424fa39c1334857ceaa (diff)
parent3ed0fd930371823b6d44ae64d00dbd79e421a552 (diff)
downloadcatch3-268698be92962247a21a86dda4de2d4267adcf8f.tar.gz
Merge pull request #36 from Progmasoft/feature/cpp-tools
Move the tools from Python to C++17 and Bazel
Diffstat (limited to 'tools/CheckMain.cpp')
-rw-r--r--tools/CheckMain.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/CheckMain.cpp b/tools/CheckMain.cpp
new file mode 100644
index 00000000..ee37d868
--- /dev/null
+++ b/tools/CheckMain.cpp
@@ -0,0 +1,41 @@
+// Copyright (c) 2026 Progmasoft.
+// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0
+
+// bazelisk run //tools:check
+
+#include <iostream>
+
+#include "tools/Amalgamation.hpp"
+#include "tools/Checks.hpp"
+#include "tools/Repository.hpp"
+#include "tools/Versions.hpp"
+
+int
+main(int argc, char **)
+{
+ using namespace Progmasoft::Catch3::Tools;
+
+ if (argc != 1)
+ {
+ std::cerr << "usage: bazelisk run //tools:check\n";
+ return 2;
+ }
+ const auto root = RepositoryRoot();
+ if (!root)
+ {
+ std::cerr << "run this tool with bazelisk run\n";
+ return 2;
+ }
+ Problems problems;
+ CheckLicenses(*root, problems);
+ CheckConvenienceHeaders(*root, problems);
+ CheckPragmaOnce(*root, problems);
+ CheckDuplicateFilenames(*root, problems);
+ CheckVersions(*root, problems);
+ const auto amalgamation = GenerateAmalgamation(*root, problems);
+ if (problems.empty())
+ {
+ CheckAmalgamation(*root, amalgamation, problems);
+ }
+ return Finish(problems);
+}