Skip to content

Commit

Permalink
feat: add bazel tests (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy authored Sep 8, 2023
1 parent aad7a72 commit e1d4193
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test
17 changes: 17 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: bazel

on: [pull_request]

jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: bazelisk test ...
working-directory: test
8 changes: 8 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ package(default_visibility = ["//visibility:public"])

cc_library(
name = "boost.filesystem",
srcs = glob([
"src/**/*.hpp",
"src/**/*.cpp",
]),
hdrs = glob([
"include/**/*.hpp",
"include/**/*.h",
]),
defines = [
"BOOST_ALL_NO_LIB",
"BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF",
],
includes = ["include"],
deps = [
"@boost.assert",
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bazel_dep(name = "boost.atomic", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.config", version = "1.83.0.bzl.6")
bazel_dep(name = "boost.container_hash", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.core", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.detail", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.detail", version = "1.83.0.bzl.2")
bazel_dep(name = "boost.io", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.iterator", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.predef", version = "1.83.0.bzl.1")
Expand Down
1 change: 1 addition & 0 deletions test/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import %workspace%/../.bazelrc
6 changes: 6 additions & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bazel
/bazel-*
/external
/.cache
/compile_commands.json
user.bazelrc
10 changes: 10 additions & 0 deletions test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_cc//cc:defs.bzl", "cc_test")

cc_test(
name = "copy_test",
srcs = ["copy_test.cpp"],
deps = [
"@boost.test",
"@boost.filesystem",
],
)
10 changes: 10 additions & 0 deletions test/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module(name = "boost.filesystem.test")

bazel_dep(name = "rules_cc", version = "0.0.8")
bazel_dep(name = "boost.test", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.filesystem")

local_path_override(
module_name = "boost.filesystem",
path = "..",
)
1 change: 1 addition & 0 deletions test/WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# SEE: MODULE.bazel

0 comments on commit e1d4193

Please sign in to comment.