generated from bazel-contrib/rules-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBUILD.bazel
48 lines (43 loc) · 895 Bytes
/
BUILD.bazel
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
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
cc_test(
name = "test",
size = "small",
srcs = [
"test.cpp",
],
deps = [
"//lib",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
cc_binary(
name = "bin",
srcs = ["main.cpp"],
deps = [
"//lib",
],
)
write_file(
name = "expected_output",
out = "expected_output.txt",
content = [
"Hello from our dynamic library!",
"add5(5) = 10",
"Nothing to do here since we don't have any global memory",
"",
],
)
genrule(
name = "current_output",
srcs = [],
outs = ["current_output.txt"],
cmd = "$(location :bin) > $@",
tools = [":bin"],
)
diff_test(
name = "spec",
file1 = ":expected_output",
file2 = ":current_output",
)