Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: Comment annotation for execution behavior #105

Open
cedihegi opened this issue Jul 16, 2023 · 2 comments
Open

Feature suggestion: Comment annotation for execution behavior #105

cedihegi opened this issue Jul 16, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@cedihegi
Copy link
Contributor

Hey, so for my use-case it would be really useful if these comment annotations were also possible to be used to specify the runtime behavior of the generated executables.
In particular, comments of the form //~PANIC: XXX to specify that a file panics on a specific line, containing XXX in its error message.
I am willing to implement this, but I just wanted to ask first what you think about this and whether this would be accepted.
Cheers :)

@oli-obk
Copy link
Owner

oli-obk commented Jul 17, 2023

The main issue with this is parsing the output of the program to look for panics. With rustc we get nice json output... Tho I realize now that's only until rustc ICEs. And ICE tests are already something that works badly in the rustc test suite.

I guess we could add a parser specifically for the default Rust panic format (tho we'll probably have to add a way to override it, to allow non-default panic handlers and arbitrary non-panic failure parsers).

I'll think about how to best do this (suggestions are welcome), as I've wanted to allow people to use something other than rustc and not have to match the json output, but instead be able to provide their own parser.

I don't want to spread Box<dyn Fn(SomeInput) -> SomeOutput> in arguments and fields everywhere, so I need to figure out how to split this crate up further into lego-like components. As an example of what I mean, look at #92 which made the threading logic fully independent of the actual test suite.

@oli-obk
Copy link
Owner

oli-obk commented Apr 7, 2024

This should be implementable now. //@run is just a custom post-test-compiled-successfully handler now

@oli-obk oli-obk mentioned this issue Apr 30, 2024
2 tasks
@oli-obk oli-obk added enhancement New feature or request help wanted Extra attention is needed labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants