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!
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| exports_files(["grep_check.py"]) |
There was a problem hiding this comment.
I guess this should not be needed
There was a problem hiding this comment.
Actually, I do need it.
Without it, the grep_check.py file would need to be in the same directory where the tests are defined.
I'm completely lost as to what this means. |
ffeae11 to
3e71779
Compare
3e71779 to
f578d76
Compare
Allow accepting multiple files Remove incorrect help (we cannot check log files of failing tests)
Since tests are not being invoked from a python file anymore we need to run bazel test //...
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.
There was a problem hiding this comment.
Why are there changes to this file?
| "//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/)?
| 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?
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.