fix up BUILD.bazel, move lcov_parser rules into subdir
Some of the BUILD.bazel rules for lcov_parser were broken
* get_changed_lines.py was renamed to changed_lines.py during review
* incrememtal -> incremental
* the `deps` field was using file names instead of targets.
* mark incremental_coverage as a binary since it has a main
* move the lcov_parser rules into their subdir
* ran formatter over /BUILD.bazel, which alphabetized a few things
TESTED: `bazel test ...` now works as expected.
Change-Id: I698857a5a4d1603e3c7f485a0167cb7b6448fa93
Signed-off-by: Daniel Latypov <dlatypov@google.com>
diff --git a/BUILD.bazel b/BUILD.bazel
index abc1179..577439c 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -9,12 +9,12 @@
pkg_tar(
name = "lcov_configs",
- package_dir = "/lcov",
srcs = [
- "lcov/lcov.css",
"lcov/emerald.png",
+ "lcov/lcov.css",
"lcov/ruby.png",
],
+ package_dir = "/lcov",
)
# build container using kunit.sh and latest kunitconfig from gerrit
@@ -28,9 +28,9 @@
"kunit.sh",
"@kunitconfig_repo//:kunitconfig",
],
- tars = ["lcov_configs"],
mode = "777",
repository = "kunit-presubmit/kunit",
+ tars = ["lcov_configs"],
)
container_push(
@@ -52,39 +52,3 @@
tars = ["@kunit_repo//:files"],
workdir = "/kunit/linux",
)
-
-py_library(
- name = "lcov_parser",
- srcs = ["lcov_parser/lcov_parser.py"],
-)
-
-py_test(
- name = "lcov_parser_test",
- srcs = ["lcov_parser/lcov_parser_test.py"],
- python_version = "PY3",
- deps = ["lcov_parser/lcov_parser.py"],
-)
-
-py_library(
- name = "get_changed_lines",
- srcs = ["lcov_parser/get_changed_lines.py"],
-)
-
-py_test(
- name = "get_changed_lines_test",
- srcs = ["lcov_parser/get_changed_lines_test.py"],
- python_version = "PY3",
- deps = ["lcov_parser/get_changed_lines.py"],
-)
-
-py_library(
- name = "incrememtal_coverage",
- srcs = ["lcov_parser/incrememtal_coverage.py"],
-)
-
-py_test(
- name = "incrememtal_coverage_test",
- srcs = ["lcov_parser/incrememtal_coverage_test.py"],
- python_version = "PY3",
- deps = ["lcov_parser/incrememtal_coverage.py"],
-)
diff --git a/lcov_parser/BUILD.bazel b/lcov_parser/BUILD.bazel
new file mode 100644
index 0000000..d7a8386
--- /dev/null
+++ b/lcov_parser/BUILD.bazel
@@ -0,0 +1,35 @@
+py_library(
+ name = "lcov_parser",
+ srcs = ["lcov_parser.py"],
+)
+
+py_test(
+ name = "lcov_parser_test",
+ srcs = ["lcov_parser_test.py"],
+ python_version = "PY3",
+ deps = [":lcov_parser"],
+)
+
+py_library(
+ name = "changed_lines",
+ srcs = ["changed_lines.py"],
+)
+
+py_test(
+ name = "changed_lines_test",
+ srcs = ["changed_lines_test.py"],
+ python_version = "PY3",
+ deps = [":changed_lines"],
+)
+
+py_binary(
+ name = "incremental_coverage",
+ srcs = ["incremental_coverage.py"],
+)
+
+py_test(
+ name = "incremental_coverage_test",
+ srcs = ["incremental_coverage_test.py"],
+ python_version = "PY3",
+ deps = [":incremental_coverage"],
+)