aboutsummaryrefslogtreecommitdiff
path: root/lib/libk/BUILD.bazel
blob: 51b4c1b7874867493a4945f2aca169e0b3f146de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
filegroup(
    name = "k_srcs",
    srcs = [
        "endian/little.c",
        "stdio/fprintf.c",
        "stdio/printf.c",
        "stdio/vfprintf.c",
        "stdlib/linked_list_allocator.c",
        "stdlib/memcpy.c",
        "stdlib/memset.c",
        "string/itoa.c",
    ],
)

cc_library(
    name = "k",
    srcs = [":k_srcs"],
    hdrs = glob(["include/*.h"]),
    includes = ["include"],
    target_compatible_with = [
        "@platforms//os:none",
    ],
    visibility = ["//visibility:public"],
)

# tests
cc_library(
    name = "k_sut",
    includes = ["."],
    target_compatible_with = select({
        "@platforms//os:none": ["@platforms//:incompatible"],
        "//conditions:default": [],
    }),
    textual_hdrs = [":k_srcs"],
)

cc_test(
    name = "test_endian_little",
    srcs = [
        "endian/test_endian_little.cc",
    ],
    deps = [
        ":k_sut",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "test_linked_list_allocator",
    srcs = [
        "stdlib/test_allocator.hh",
        "stdlib/test_linked_list_allocator.cc",
    ],
    deps = [
        ":k_sut",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "test_mem",
    srcs = [
        "stdlib/test_mem.cc",
    ],
    deps = [
        ":k_sut",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "test_string",
    srcs = [
        "string/test_string.cc",
    ],
    deps = [
        ":k_sut",
        "@googletest//:gtest_main",
    ],
)