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

Add test selector god-cli-flag #37

Open
Gankra opened this issue Jun 30, 2024 · 0 comments
Open

Add test selector god-cli-flag #37

Gankra opened this issue Jun 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Gankra
Copy link
Owner

Gankra commented Jun 30, 2024

We have logic to uniquely generate keys for a given TestKey, ensuring outputs have non-colliding names. As a corrollory you can technically refer to any combination of options with a really::long::list::of::options::like::this, but there's no way to provide that input or parse it. It would essentially be the reverse of this base_id, taking a string and producing a TestKey:

abi-cafe/src/harness/mod.rs

Lines 208 to 229 in 6ba6865

impl TestHarness {
pub fn base_id(
&self,
TestKey {
test,
options:
TestOptions {
convention,
functions,
val_writer,
val_generator,
},
caller,
callee,
}: &TestKey,
call_side: Option<CallSide>,
separator: &str,
) -> String {
let mut output = format!("{test}{separator}{convention}");
if let FunctionSelector::One { idx, args } = functions {
let test = self.tests[test].clone();
let func = test.types.realize_func(*idx);

This is mildly annoying to do because I decided options should be omitted if they're the default (for compactness), so you need to do a lot of "try to parse as WriteImpl, no, ok, what about..." to reverse the process. In principle it can be done though, and it would be very nice to be able to dump an id into the CLI and have it spit out exactly what you want!

@Gankra Gankra added the enhancement New feature or request label Jun 30, 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
Projects
None yet
Development

No branches or pull requests

1 participant