Create a unit_test macro#213
Conversation
01027e4 to
3013225
Compare
nettle
left a comment
There was a problem hiding this comment.
I like the idea!
However I would consider not mixing python tests and bazel tests.
But as a prototype it is definitely good!
And, as @Szelethus mentioned, we need a strategy for bazel tests.
And... please dont touch legacy tests - I need them as the reference!
I'm completely lost as to what this means. |
ffeae11 to
3e71779
Compare
f578d76 to
41ccf6b
Compare
|
I have left this patch alone for a long time 😅. So I realized that almost every unit test (except cache tests) is convertable to this format. |
Szelethus
left a comment
There was a problem hiding this comment.
I don't think the PR name is very descriptive right now, because it adds a new macro, and demonstrates the usage on the virtual include tests.
I hate to be that guy (twice in one day), but can we fragment this just a little bit more? Can you at least put the test rewrite demo to a separate PR?
I like the overall direction, btw. Lets make sure we discuss with @nettle to avoid sinking too much effort into an idea that won't make the cut.
| "//src:codechecker.bzl", | ||
| "codechecker_test", | ||
| ) | ||
| load( | ||
| "//test/unit:unit_test.bzl", |
There was a problem hiding this comment.
How come src is followed with a colon (src:), but test is with a forward slash (test/)?
There was a problem hiding this comment.
Because codechecker.bzl is a target inside the src package, while unit is a package inside the test package.
I think you meant why I placed the macro inside the unit folder?
I think it makes sense to place the unit tests and related files into the unit folder.
| negative_patterns = ["my_negative_pattern"], | ||
| regex_patterns = ["my_.*regex.*_pattern"], | ||
| negative_regex_patterns = ["my_.*negative_regex.*_pattern"], |
There was a problem hiding this comment.
patterns and regex_patterns? That sounds rather congusing. How about, instead of pattern, use substr or contains as a parameter name?
There was a problem hiding this comment.
Thanks, that's a much better name!
e06ad27 to
36fd666
Compare
Allow accepting multiple files Remove incorrect help (we cannot check log files of failing tests)
0687a36 to
973d898
Compare
Why:
We want to integrate our tests into Bazel.
What:
Addresses:
#210
Notes:
In very old Bazel versions (older than 6.4.0),
bazel test ...must get the flag:--experimental_cc_implementation_deps.