-
Notifications
You must be signed in to change notification settings - Fork 422
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
[WIP] Arm Best Practices Refactor #1850
Conversation
Hey @mark-lunarg, I'm wondering about the best way to approach using the code-generating scripts in order to implement the functions of the I want all functions, PreCallValidateX, PreCallRecordX, and PostCallRecordX, to have the following code:
where It seems like the generator scripts for |
b204b94
to
96c6736
Compare
Update: I managed to get everything to the point where there's a new generator script which outputs the After a lot of trial and error, everything builds. However, it looks like the changes mean that none of the validation layers are executed... I'm not sure why at the moment. It looks like, for example, when a test involving I'll continue looking into that. |
Hey, @mark-lunarg, I think I managed to isolate the issues with windows builds. Let me know if that works. |
b5697cf
to
96bc144
Compare
All the best practices tests are passing now on windows + linux! Next steps on this would be to further refine what we want out of the vendor agreement system. Then, we can write tests against that definition. |
…ased on the class type
4963895
to
74881fa
Compare
At commit 74881fa everything passed except for a single test:
I'm not sure what caused this, or what part of my changes could be causing this, if any. EDIT: I tried out this test on the exact commit locally. It passes on my linux setup. |
I've added work-in-progress unit tests for behaviour in the check system itself, just so I can illustrate something I'm struggling with. For some reason, I can't link code defined in
|
I've fixed those build issues now (the fix involved repeatedly re-compiling, and adding cpp files containing the missing definitions to the Apart from this, see the unit tests in the |
@samwalls-arm, sorry, just saw your two last comments. We'd like to avoid adding any of the chassis framework stuff to the tests. There are a few layer files included, but they are pretty much standalone utility files. Maybe a static routine defined in a header file? I'll take a look at the unit tests... |
@mark-lunarg Yes, I wasn't sure if this was a good solution. It also looks like I won't be able to appropriately mock the layer framework in the tests themselves, at the moment. I think I should remove the tests for now. We may figure out a way of using them properly later. |
Adding a link to this PR to the Best Practices Tracking issue #24, in case these changes become necessary in the future. |
Overview
Here's the beginnings of some features we've discussed. This is still work-in-progress, but I welcome feedback and criticism: I may be missing some assumptions in the codebase, and there's probably still a few things to discuss in regards to these additions.
The main aim of these changes are to make the best practices system easier to maintain, and extend. This is mainly achieved through making it easier to logically separate individual checks from each other. However, there are additionally changes made which allow vendors to agree with specific checks. This has the advantage of handling cases where: checks provided from vendor A may be beneficial to endorse for vendor B, too, but perhaps not vendor C.
Here's some diagrams explaining the desired "before and after".
Before
After
Still TODO
At the moment, I've moved all of the checks that existed into a class
class MyExampleBestPractices : public BestPracticeBase
. However, this is only to move the refactored framework to a state where all the best-practice tests pass, to demonstrate its operation. In the final iteration, we would want to split this class up.Code generation for best practice harness code.It looks like theAPICallHookInterface
interface I abstracted out will not be sufficient. The interface for best practices should include all functions withstate_data
parameters. This may require another code generator script?ManualPostCallRecordX
functionsHow best to split current checks + assign IDs? Should there be such a thing as a "class of checks" which can be agreed with, or should checks always be individually referenced?