Skip to content

Conversation

@camshaft
Copy link
Owner

@camshaft camshaft commented Nov 9, 2021

closes #39

@Ekleog-NEAR
Copy link
Contributor

Just thinking: would it make sense, in addition to this, to have a #[bolero::non_fuzz_test] or similar macro?

This’d allow the tests to be skipped when run with BOLERO_LIBFUZZER_ARGS, CARGO_BOLERO_SELECT, or any similar environment variable, and thus to make listing probably significantly faster

@camshaft
Copy link
Owner Author

I'd really like to fix the listing in a different way, ideally by embedding sections in the output artifact and cargo-bolero reading from those. This way we don't have to run the program at all and the user doesn't have to go annotate a bunch of slower tests.

@Ekleog-NEAR
Copy link
Contributor

That’d definitely be a much better solution, you’re right!

@Ekleog-NEAR
Copy link
Contributor

I thought about it some more, and it turns out that:

  • Linker-based test listing is hard
  • If a #[bolero::test] macro is added, we no longer need bolero::check!()
  • With a #[bolero::test] proc macro, making a list becomes trivial: just have the proc macro output an additional item #[test] fn __bolero_internal_list__{test_name}() that just outputs the JSON information, and run cargo test __bolero_internal_list__

As such, I think a reasonable way forward would be:

  • Add a #[bolero::test] macro that in addition to the test, also adds the __bolero_internal_list__{test_name}
  • Remove the current bolero::check macro
  • Make cargo list use cargo test __bolero_internal_list__

WDYT?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement test attribute

3 participants