Any way to add a custom "UniqueFor"? #1029
Replies: 2 comments 1 reply
-
Hm, I think I found a way to do this... do let me know if this is unadvisable though (I discovered this reading the source code - not the docs): [ModuleInitializer]
public static void Init()
{
#if AOT_ENABLED
Verifier.DerivePathInfo((sourceFile, projectDirectory, type, method) => new(
directory: projectDirectory,
typeName: type.Name,
// This ensures a unique name for our verify files when performing AOT compilation
methodName: method.Name + ".AOT"
));
#endif
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
Nice, thanks @SimonCropp ! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the docs, it looks like UniqueFor can be used to add delimiters to the file names used...
In our case, we want to run the same tests in two different scenarios:
We expect the resulting verified files to be different in those two different sceanrios, so I was looking for something in
VerifierSettings
that I could use to ensure the two sets of files would have different names.So, we already have names like
MethodBeingTested.Run.DotNet7_0.verified.txt
... I'd like to have some additional tests run that generate some separate files calledMethodBeingTested.Run.DotNet7_0.Aot.verified.txt
or something like that.Ideally this could be done in a
ModuleInitializer
once for our whole project/solution... rather than configuring it for every verify test we have individually.Is something like that possible? I didn't see any obvious solution looking at the docs or reading through discussions here.
Beta Was this translation helpful? Give feedback.
All reactions