Skip to content

Convert unit tests into the new unit_test macro - #248

Open
furtib wants to merge 6 commits into
Ericsson:mainfrom
furtib:test_into_bazel_002
Open

Convert unit tests into the new unit_test macro#248
furtib wants to merge 6 commits into
Ericsson:mainfrom
furtib:test_into_bazel_002

Conversation

@furtib

@furtib furtib commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Why:
We want our tests to run with bazel test //....

What:

  • Rewritten every test where possible as the new unit_test macro

Addresses:
#210

@furtib furtib self-assigned this Jun 18, 2026
@furtib
furtib force-pushed the test_into_bazel_002 branch 3 times, most recently from 580a3b3 to 2766f71 Compare June 18, 2026 14:54
@furtib
furtib force-pushed the test_into_bazel_002 branch from 2766f71 to ba3a54c Compare June 27, 2026 07:19
@furtib furtib changed the title Demonstrate virtual_include test using the unit_test macro Convert unit tests into the new unit_test macro Jun 30, 2026
@furtib
furtib marked this pull request as ready for review June 30, 2026 08:06
@furtib
furtib force-pushed the test_into_bazel_002 branch from 079dc29 to b9ecaf0 Compare June 30, 2026 08:07
@furtib
furtib requested a review from Szelethus June 30, 2026 08:08

@Szelethus Szelethus left a comment

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.

I haven't read the PR in its entirety, just a preliminary comment.

Comment thread src/per_file.bzl Outdated
all_files = [compile_commands]
config_file, env_vars = get_config_file(ctx)
_create_wrapper_script(ctx, options, compile_commands, config_file)
all_files = [compile_commands, config_file]

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.

Considering the nature of this PR, it would be amazing to land this separately and make this NFC.

@furtib furtib Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was done in a separate PR already, but has not been rebased yet.
(After rebase, this line was duplicated, despite no merge conflicts)

@furtib
furtib force-pushed the test_into_bazel_002 branch from b9ecaf0 to 81c0047 Compare July 5, 2026 10:13
@furtib furtib added the non-functional change ☮️ The patch doesn't change any functionality, e.g. refactoring, documentation, test-only. label Jul 5, 2026
unit_test(
name = "per_file_genrule_header_test",
contains = [
"genrule_header.h",

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.

The original test checks for "defect\(s\) in genrule_header.h"

unit_test(
name = "per_file_genrule_source_test",
contains = [
"genrule_source.cc",

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.

same here

Comment on lines -91 to -93
self.assertNotEqual(
self.contains_in_files(r"/_virtual_includes/", plist_files), []
)

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.

Is this present in the new tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

non-functional change ☮️ The patch doesn't change any functionality, e.g. refactoring, documentation, test-only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants