Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions clwb/tests/projects/simple/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "googletest",
sha256 = "8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7", # pragma: allowlist secret
strip_prefix = "googletest-1.14.0",
urls = ["https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz"],
)
12 changes: 11 additions & 1 deletion clwb/tests/projects/simple/main/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test")

cc_binary(
name = "hello-world",
srcs = ["hello-world.cc"],
visibility = ["//visibility:public"]
)

cc_test(
name = "hello-test",
size = "small",
srcs = ["hello-test.cc"],
deps = [
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
9 changes: 9 additions & 0 deletions clwb/tests/projects/simple/main/hello-test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <gtest/gtest.h>

// Demonstrate some basic assertions.
TEST(HelloTest, BasicAssertions) {
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
}