Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
filegroup(
name = "all_sources",
srcs = glob(
["**/*"],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's definitely no good :(
Never do that in Bazel!

exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

sh_test(
name = "integration_tests",
srcs = ["test/test_runner.sh"],
data = [
":all_sources",
"//src:all_src_sources",
"//test/unit/legacy:all_files",
"//test/unit/parse:all_files",
"//test/unit/implementation_deps:all_files",
"//test/unit/generated_files:all_files",
"//test/unit/config:all_files",
"//test/unit/compile_flags:all_files",
"//test/unit/caching:all_files",
"//test/unit/argument_merge:all_files",
"//test/unit/virtual_include:all_files",
],
tags = [
"local",
"exclusive",
],
size = "large",
timeout = "long",
)
13 changes: 13 additions & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

filegroup(
name = "all_src_sources",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

# Tool filter compile_commands.json file
py_binary(
name = "compile_commands_filter",
Expand Down
1 change: 1 addition & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
# This file is tied to a CI job and thus can't be changed
python3 -m unittest discover unit $@
2 changes: 2 additions & 0 deletions test/test_runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
python3 -m unittest discover -t . -s test/unit $@
Comment on lines +1 to +2
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, use py_test() at least :)

13 changes: 13 additions & 0 deletions test/unit/argument_merge/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ load(
"cc_library",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

cc_library(
name = "main",
srcs = ["main.cc"],
Expand Down
13 changes: 13 additions & 0 deletions test/unit/caching/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ load(
"cc_library",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

# We are not interested in finding bugs, we are only interested in whether the
# analysis re-runs after the files have been modified. As such, these files emit no
# warnings.
Expand Down
13 changes: 13 additions & 0 deletions test/unit/compile_flags/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ load(
"cc_library",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

cc_library(
name = "target_with_both_extension",
srcs = [
Expand Down
13 changes: 13 additions & 0 deletions test/unit/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ load(
"cc_binary",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

# C++ binary containing a division by zero bug
cc_binary(
name = "test_zero",
Expand Down
13 changes: 13 additions & 0 deletions test/unit/generated_files/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ load(
"cc_binary",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

# First, define the rule that generates our file.
genrule(
name = "generate_header",
Expand Down
13 changes: 13 additions & 0 deletions test/unit/implementation_deps/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ load(
"compile_commands",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

cc_library(
name = "dep_lib",
srcs = [
Expand Down
13 changes: 13 additions & 0 deletions test/unit/legacy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ load(
"cc_library",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

# Test for strip_include_prefix
cc_library(
name = "test_inc",
Expand Down
13 changes: 13 additions & 0 deletions test/unit/parse/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ load(
"cc_library",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

cc_library(
name = "c_target",
srcs = ["simple.c"],
Expand Down
13 changes: 13 additions & 0 deletions test/unit/virtual_include/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ load(
"cc_library",
)

filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"bazel-*/**", # Exclude bazel symlinks
".git/**",
"**/__pycache__/**",
],
),
visibility = ["//visibility:public"],
)

# Test for strip_include_prefix
cc_library(
name = "test_inc",
Expand Down
Loading