Skip to content

Commit

Permalink
Add fmt as a dependency
Browse files Browse the repository at this point in the history
Change-Id: I8df98ad421c0dce482ce2d8d5c1304c2d0936c4d
  • Loading branch information
oliverlee committed Jul 21, 2023
1 parent 994e75a commit c170c30
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
14 changes: 14 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ register_toolchains(
"@gcc_12_toolchain//:toolchain",
)

FMT_VERSION = "dd5a9691f992f7f257243cbecb516a4ab584dcde"

http_archive(
name = "fmt",
patch_cmds = [
"mv support/bazel/.bazelversion .bazelversion",
"mv support/bazel/BUILD.bazel BUILD.bazel",
"mv support/bazel/WORKSPACE.bazel WORKSPACE.bazel",
],
sha256 = "02289e247321e4984fcfc185e1bcaf6ace9622ad6e034f326677da4b53c7a92d",
strip_prefix = "fmt-%s" % FMT_VERSION,
url = "https://github.com/fmtlib/fmt/archive/%s.tar.gz" % FMT_VERSION,
)

BOOST_UT_VERSION = "e53a47d37bc594e80bd5f1b8dc1ade8dce4429d3"

http_archive(
Expand Down
1 change: 1 addition & 0 deletions test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ cc_test(
srcs = ["dummy_test.cpp"],
deps = [
"@boost_ut",
"@fmt",
],
)
8 changes: 7 additions & 1 deletion test/dummy_test.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#include <boost/ut.hpp>

#include <fmt/core.h>

auto main() -> int
{
using ::boost::ut::expect;
using ::boost::ut::test;

test("true is true") = [] { expect(true); };
test("true is true") = [] {
const auto s = fmt::format("The answer is {}.", 42);

expect("The answer is 42." == s);
};
}

0 comments on commit c170c30

Please sign in to comment.