diff --git a/BUILD b/BUILD new file mode 100644 index 00000000..e94b2e4b --- /dev/null +++ b/BUILD @@ -0,0 +1,36 @@ +filegroup( + name = "all_sources", + srcs = glob( + ["**/*"], + 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", +) diff --git a/src/BUILD b/src/BUILD index 029908cd..129ddc5f 100644 --- a/src/BUILD +++ b/src/BUILD @@ -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", diff --git a/test/test.sh b/test/test.sh index 8b9d4b01..971b79ec 100755 --- a/test/test.sh +++ b/test/test.sh @@ -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 $@ diff --git a/test/test_runner.sh b/test/test_runner.sh new file mode 100755 index 00000000..2982d96c --- /dev/null +++ b/test/test_runner.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +python3 -m unittest discover -t . -s test/unit $@ diff --git a/test/unit/argument_merge/BUILD b/test/unit/argument_merge/BUILD index 7bfb7d69..4be9b8f3 100644 --- a/test/unit/argument_merge/BUILD +++ b/test/unit/argument_merge/BUILD @@ -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"], diff --git a/test/unit/caching/BUILD b/test/unit/caching/BUILD index 5673ac10..acac7e54 100644 --- a/test/unit/caching/BUILD +++ b/test/unit/caching/BUILD @@ -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. diff --git a/test/unit/compile_flags/BUILD b/test/unit/compile_flags/BUILD index 01f30125..50dd3580 100644 --- a/test/unit/compile_flags/BUILD +++ b/test/unit/compile_flags/BUILD @@ -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 = [ diff --git a/test/unit/config/BUILD b/test/unit/config/BUILD index 39dc8a0d..a056f694 100644 --- a/test/unit/config/BUILD +++ b/test/unit/config/BUILD @@ -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", diff --git a/test/unit/generated_files/BUILD b/test/unit/generated_files/BUILD index 9cd7733a..53de1c80 100644 --- a/test/unit/generated_files/BUILD +++ b/test/unit/generated_files/BUILD @@ -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", diff --git a/test/unit/implementation_deps/BUILD b/test/unit/implementation_deps/BUILD index 4733e1ee..6bf8a282 100644 --- a/test/unit/implementation_deps/BUILD +++ b/test/unit/implementation_deps/BUILD @@ -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 = [ diff --git a/test/unit/legacy/BUILD b/test/unit/legacy/BUILD index 3e263675..296b4669 100644 --- a/test/unit/legacy/BUILD +++ b/test/unit/legacy/BUILD @@ -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", diff --git a/test/unit/parse/BUILD b/test/unit/parse/BUILD index d50e25c9..68c7734b 100644 --- a/test/unit/parse/BUILD +++ b/test/unit/parse/BUILD @@ -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"], diff --git a/test/unit/virtual_include/BUILD b/test/unit/virtual_include/BUILD index beaad605..e6c04c3d 100644 --- a/test/unit/virtual_include/BUILD +++ b/test/unit/virtual_include/BUILD @@ -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",