Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

develroot / tools / BUILD.bazel

2.4 KiB · Raw · Log

# Copyright (c) 2026 Progmasoft.
# SPDX-License-Identifier: LGPL-3.0-or-later
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")

# The tools of this repository. They work on the checkout:
#
#     bazelisk run //tools:<tool>
#     bazelisk run //tools:<tool> -- <arguments>
CPP17 = select({
    "@platforms//os:windows": ["/std:c++17"],
    "//conditions:default": ["-std=c++17"],
})

cc_library(
    name = "library",
    srcs = [
        "Amalgamation.cpp",
        "Checks.cpp",
        "Repository.cpp",
        "RepositoryReport.cpp",
        "Versions.cpp",
    ],
    hdrs = [
        "Amalgamation.hpp",
        "Checks.hpp",
        "Repository.hpp",
        "RepositoryReport.hpp",
        "Versions.hpp",
    ],
    copts = CPP17,
    deps = ["//third_party/yyjson"],
)

cc_binary(
    name = "amalgamate",
    srcs = ["AmalgamateMain.cpp"],
    copts = CPP17,
    deps = [":library"],
)

cc_binary(
    name = "check",
    srcs = ["CheckMain.cpp"],
    copts = CPP17,
    deps = [":library"],
)

cc_binary(
    name = "release_notes",
    srcs = ["ReleaseNotesMain.cpp"],
    copts = CPP17,
    deps = [":library"],
)

cc_binary(
    name = "repo_info",
    srcs = ["RepoInfoMain.cpp"],
    copts = CPP17,
    deps = [":library"],
)

cc_binary(
    name = "version",
    srcs = ["VersionMain.cpp"],
    copts = CPP17,
    deps = [":library"],
)

cc_binary(
    name = "third_party",
    srcs = ["ThirdPartyMain.cpp"],
    args = [
        "third_party/yyjson/yyjson.c=$(rlocationpath @yyjson_archive//:src/yyjson.c)",
        "third_party/yyjson/yyjson.h=$(rlocationpath @yyjson_archive//:src/yyjson.h)",
        "third_party/pugixml/pugiconfig.hpp=$(rlocationpath @pugixml_archive//:src/pugiconfig.hpp)",
        "third_party/pugixml/pugixml.cpp=$(rlocationpath @pugixml_archive//:src/pugixml.cpp)",
        "third_party/pugixml/pugixml.hpp=$(rlocationpath @pugixml_archive//:src/pugixml.hpp)",
    ],
    copts = CPP17,
    data = [
        "@pugixml_archive//:src/pugiconfig.hpp",
        "@pugixml_archive//:src/pugixml.cpp",
        "@pugixml_archive//:src/pugixml.hpp",
        "@yyjson_archive//:src/yyjson.c",
        "@yyjson_archive//:src/yyjson.h",
    ],
    deps = [
        ":library",
        "@rules_cc//cc/runfiles",
    ],
)

cc_test(
    name = "tools_tests",
    srcs = ["Tools.tests.cpp"],
    copts = CPP17,
    deps = [
        ":library",
        "//:catch3_main",
    ],
)