mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
Add bazel support
This commit is contained in:
parent
10e50ad70c
commit
e1dfa30e38
4 changed files with 94 additions and 0 deletions
39
.gitignore
vendored
39
.gitignore
vendored
|
|
@ -42,3 +42,42 @@ Makefile.in
|
|||
*.log
|
||||
*.trs
|
||||
*.pc
|
||||
|
||||
# Bazel
|
||||
MODULE.bazel.lock
|
||||
# Ignore backup files.
|
||||
*~
|
||||
# Ignore Vim swap files.
|
||||
.*.swp
|
||||
# macOS-specific excludes
|
||||
.DS_Store
|
||||
# Ignore files generated by IDEs.
|
||||
/.aswb/
|
||||
/.bazelbsp/
|
||||
/.cache/
|
||||
/.classpath
|
||||
/.clwb/
|
||||
/.factorypath
|
||||
/.idea/
|
||||
/.ijwb/
|
||||
/.project
|
||||
/.settings
|
||||
/.vscode/
|
||||
.eclipse/
|
||||
.settings/
|
||||
.classpath
|
||||
.project
|
||||
eclipse-*bin/
|
||||
/bazel.iml
|
||||
# Ignore all bazel-* symlinks. There is no full list since this can change
|
||||
# based on the name of the directory bazel is cloned into.
|
||||
/bazel-*
|
||||
# Ignore outputs generated during Bazel bootstrapping.
|
||||
/output/
|
||||
# Ignore jekyll build output.
|
||||
/production
|
||||
/.sass-cache
|
||||
# Bazelisk version file
|
||||
.bazelversion
|
||||
# User-specific .bazelrc
|
||||
user.bazelrc
|
||||
|
|
|
|||
32
BUILD.bazel
Normal file
32
BUILD.bazel
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "unittest-cpp",
|
||||
srcs = glob([
|
||||
"UnitTest++/*.h",
|
||||
"UnitTest++/*.cpp",
|
||||
]) + select({
|
||||
"@platforms//os:windows": glob([
|
||||
"UnitTest++/Win32/*.h",
|
||||
"UnitTest++/Win32/*.cpp",
|
||||
]),
|
||||
"//conditions:default": glob([
|
||||
"UnitTest++/Posix/*.h",
|
||||
"UnitTest++/Posix/*.cpp",
|
||||
]),
|
||||
}),
|
||||
hdrs = [
|
||||
"UnitTest++/UnitTest++.h",
|
||||
"UnitTest++/UnitTestPP.h",
|
||||
],
|
||||
copts = select({
|
||||
"@platforms//os:windows": [
|
||||
"-D_CRT_SECURE_NO_DEPRECATE", # Windows-specific define
|
||||
],
|
||||
"//conditions:default": [
|
||||
"-std=c++11", # Default to C++11 for POSIX systems
|
||||
],
|
||||
}),
|
||||
includes = ["UnitTest++"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
13
MODULE.bazel
Normal file
13
MODULE.bazel
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
"""
|
||||
Module: unittest-cpp
|
||||
Purpose: Provides the unittest++ library compileable as a Bazel target. Includes tests through Bazel
|
||||
"""
|
||||
|
||||
module(
|
||||
name = "unittest-cpp",
|
||||
version = "2.0.0-0.20201113052638-10e50ad70c69",
|
||||
compatibility_level = 1,
|
||||
)
|
||||
|
||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||
bazel_dep(name = "platforms", version = "0.0.11")
|
||||
10
tests/BUILD.bazel
Normal file
10
tests/BUILD.bazel
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
load("@rules_cc//cc:defs.bzl", "cc_test")
|
||||
|
||||
cc_test(
|
||||
name = "all_tests",
|
||||
srcs = glob([
|
||||
"*.h",
|
||||
"*.cpp",
|
||||
]),
|
||||
deps = ["//:unittest-cpp"],
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue