Skip to content

Commit 250bf6e

Browse files
committed
Add new buildfiles
1 parent 5717e1c commit 250bf6e

File tree

5 files changed

+13
-110
lines changed

5 files changed

+13
-110
lines changed

Bazel.md

Lines changed: 0 additions & 100 deletions
This file was deleted.

examples/bazel/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ bazel_dep(name = "googletest", version = "1.15.2")
99
bazel_dep(name = "libcbor")
1010
local_path_override(
1111
module_name = "libcbor",
12-
path = "../../src",
12+
path = "../..",
1313
)

examples/bazel/src/BUILD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
22
load("@rules_cc//cc:defs.bzl", "cc_binary")
33

44
cc_library(
5-
name = "src",
5+
name = "hello_lib",
66
srcs = [
77
"hello.cc",
88
],
@@ -18,7 +18,7 @@ cc_library(
1818
)
1919

2020
cc_test(
21-
name = "tests",
21+
name = "hello_test",
2222
size = "small",
2323
srcs = [
2424
"hello_test.cc",
@@ -27,8 +27,8 @@ cc_test(
2727
"//visibility:private",
2828
],
2929
deps = [
30-
":src",
31-
"@gtest//:gtest_main",
30+
":hello_lib",
31+
"@googletest//:gtest_main",
3232
"@libcbor//:cbor",
3333
],
3434
)
@@ -40,7 +40,7 @@ cc_binary(
4040
"main.cc",
4141
],
4242
deps = [
43-
":src",
43+
":hello_lib",
4444
],
4545
)
4646

examples/bazel/src/hello_test.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#include "src/hello.h"
2+
#include "cbor.h"
23

34
#include "gtest/gtest.h"
45

5-
class HelloTest : public ::testing::Test {};
6+
class CborTest : public ::testing::Test {};
67

7-
TEST_F(HelloTest, CborVersion) {
8-
EXPECT_EQ(cbor_version(), 0);
8+
TEST_F(CborTest, IntegerItem) {
9+
cbor_item_t * answer = cbor_build_uint8(42);
10+
EXPECT_EQ(cbor_get_uint8(answer), 42);
11+
cbor_decref(&answer);
12+
EXPECT_EQ(answer, nullptr);
913
}
1014

src/MODULE.bazel

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)