Skip to content

Commit

Permalink
build: Set up bazel to build the binaries and run test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaqx0r committed Feb 4, 2024
1 parent da0ac7d commit 59373cb
Show file tree
Hide file tree
Showing 5 changed files with 1,341 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ debian/patches
/*.gcov
/*.gcda
/*.gcno
/bazel-bin
/bazel-cronutils
/bazel-out
/bazel-testlogs
57 changes: 57 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
cc_library(
name = "subprocess",
srcs = ["subprocess.c"],
hdrs = ["subprocess.h"],
)

cc_library(
name = "tempdir",
srcs = ["tempdir.c"],
hdrs = ["tempdir.h"],
)

cc_binary(
name = "runalarm",
srcs = ["runalarm.c"],
deps = [":subprocess"],
)

cc_binary(
name = "runlock",
srcs = ["runlock.c"],
deps = [
":subprocess",
":tempdir",
],
)

cc_binary(
name = "runstat",
srcs = ["runstat.c"],
deps = [
":subprocess",
":tempdir",
],
)

filegroup(
name = "tests",
srcs = glob(["tests/*.sh"]),
)

filegroup(
name = "goldens",
srcs = glob(["tests/*.out"]),
)

sh_test(
name = "regtest",
srcs = ["regtest.sh"],
data = [
":goldens",
":runalarm",
":runlock",
":runstat",
":tests",
],
)
6 changes: 6 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################

0 comments on commit 59373cb

Please sign in to comment.