-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow deps to include test targets (#13)
Change-Id: I228e14a393bc1b3e95b82a07ac91425cf679591e
- Loading branch information
Showing
14 changed files
with
128 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bazel-dep-cc_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
common --enable_bzlmod=false | ||
|
||
build:clang-tidy --aspects=@rules_clang_tidy//:aspects.bzl%check | ||
build:clang-tidy --output_groups=report | ||
|
||
build:clang-tidy-export-fixes --aspects=@rules_clang_tidy//:aspects.bzl%export_fixes | ||
build:clang-tidy-export-fixes --output_groups=report | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
cc_binary( | ||
name = "foo", | ||
srcs = ["foo.cpp"], | ||
visibility = [ | ||
"//fail:__pkg__", | ||
"//pass:__pkg__", | ||
], | ||
) | ||
|
||
cc_test( | ||
name = "bar", | ||
srcs = ["bar.cpp"], | ||
visibility = [ | ||
"//fail:__pkg__", | ||
"//pass:__pkg__", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
local_repository( | ||
name = "rules_clang_tidy", | ||
path = "../..", | ||
) | ||
|
||
load("@rules_clang_tidy//:dependencies.bzl", "rules_clang_tidy_dependencies") | ||
|
||
rules_clang_tidy_dependencies() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
auto main() -> int | ||
{ | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
load("@rules_clang_tidy//:defs.bzl", "apply_fixes") | ||
|
||
apply_fixes( | ||
name = "build_fail", | ||
deps = [ | ||
"//:bar", | ||
"//:baz", # doesn't exist | ||
"//:foo", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
auto main() -> int | ||
{ | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
load("@rules_clang_tidy//:defs.bzl", "apply_fixes") | ||
|
||
apply_fixes( | ||
name = "build_pass", | ||
deps = [ | ||
"//:bar", | ||
"//:foo", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
exports_files( | ||
["true.bash"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
source test/prelude.bash | ||
|
||
check_setup example/dep-cc_test | ||
|
||
# This sets a 15 second idle timeout | ||
# https://github.com/bazelbuild/bazel/issues/11062 | ||
unset TEST_TMPDIR | ||
|
||
bazel \ | ||
--bazelrc="$test_bazelrc" \ | ||
build \ | ||
//pass/... | ||
|
||
bazel \ | ||
--bazelrc="$test_bazelrc" \ | ||
build \ | ||
//fail/... 2>&1 | tee "$log" || true | ||
|
||
grep "no such target '//:baz'" "$log" |