Skip to content

Add use_libtest_harness attribute to rust_test#754

Merged
hlopko merged 9 commits intobazelbuild:mainfrom
hlopko:no_harness_test
Jun 1, 2021
Merged

Add use_libtest_harness attribute to rust_test#754
hlopko merged 9 commits intobazelbuild:mainfrom
hlopko:no_harness_test

Conversation

@hlopko
Copy link
Copy Markdown
Member

@hlopko hlopko commented May 27, 2021

When set to False, rustc will not include libtest for the test,
therefore the test author is responsible for implementing main
function and running the tests.

@google-cla google-cla Bot added the cla: yes label May 27, 2021
@hlopko hlopko requested review from illicitonion and scentini May 27, 2021 10:19
@hlopko hlopko force-pushed the no_harness_test branch 2 times, most recently from 34a2c40 to 80818ba Compare May 27, 2021 10:28
Comment thread rust/private/rust.bzl Outdated
Comment thread test/unit/test_harness/test_harness_test.bzl Outdated
hlopko added 6 commits May 28, 2021 10:12
When set to False, rustc will not include libtest for the test,
therefore the test author is responsible for implementing `main`
function and running the tests.
@hlopko hlopko force-pushed the no_harness_test branch from e7f5762 to c3980f2 Compare May 28, 2021 08:12
@hlopko hlopko changed the title Add harness attribute to rust_test Add use_libtest_harness attribute to rust_test May 28, 2021
Copy link
Copy Markdown
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Thanks!

@hlopko hlopko merged commit ede8f11 into bazelbuild:main Jun 1, 2021
@hlopko hlopko deleted the no_harness_test branch June 1, 2021 20:16
hlopko added a commit that referenced this pull request Jun 9, 2021
Before, generated rust-project.json did not contain dependencies from the `rust_library` when `rust_test` used `.crate` attribute and the test was the only root in the `targets` attribute of `rust_analyzer` rule.

This PR depends on #754 and #760.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants