-
-
Notifications
You must be signed in to change notification settings - Fork 104
Enhance type library creation and information testing. #917
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
Open
junkmd
wants to merge
9
commits into
enthought:main
Choose a base branch
from
junkmd:create_typeinfo_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+449
−84
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ed file. Move `Test_CreateTypeLib` and `Test_ICreateTypeInfo` from `test/test_typeinfo.py` to `test/test_typeinfo_create.py`. This improves test organization by separating concerns related to type library creation into their own module.
This commit introduces the `ITypeLib2` interface definition and corresponding tests within `test_typeinfo_create.py`. Specifically, `test_Documentation2` and `test_CustData` are added to verify `ICreateTypeLib2`'s `SetDocString`, `SetHelpStringContext`, `SetHelpStringDll`, and `SetCustData` methods. The `ITypeLib2` definition is currently used for testing purposes to validate values set by `ICreateTypeLib2`. It is not yet integrated into the production codebase, and its direct adoption into production in this form is still under consideration.
Adds `test_Func_Documentation` and `test_Var_Documentation` to `test_typeinfo_create.py`. These tests verify that `ITypeInfo.GetDocumentation` correctly retrieves documentation strings, help contexts, and names for functions and variables, respectively, after being set via `ICreateTypeInfo`.
Add `test_Interface_TYPEATTR` and `test_Alias_TYPEATTR` to `test/test_typeinfo_create.py`. These tests verify that `ITypeInfo.GetTypeAttr` correctly retrieves the `TYPEATTR` structure for interfaces and aliases.
Add `test_FUNCDESC` to `test/test_typeinfo_create.py`. This test verifies the correct creation and retrieval of function descriptions (`FUNCDESC`) for an interface within a type library.
Add `test_VARDESC` to `test/test_typeinfo_create.py`. This test verifies the correct creation and retrieval of variable descriptions (`VARDESC`) for a module within a type library.
Add `test_ImplTypeFlags` to `test/test_typeinfo_create.py`. This test verifies the correct setting and retrieval of implementation type flags (`IMPLTYPEFLAG`) for interfaces within a coclass using `SetImplTypeFlags`.
Add `test_DllEntry` to `test/test_typeinfo_create.py`. This test verifies the correct setting and retrieval of DLL entry information for functions within a `TKIND_MODULE` type info using `DefineFuncAsDllEntry`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #917 +/- ##
==========================================
+ Coverage 87.30% 87.53% +0.23%
==========================================
Files 135 136 +1
Lines 12766 12975 +209
==========================================
+ Hits 11145 11358 +213
+ Misses 1621 1617 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…stently. The existing `test_Interface_TYPEATTR` was NOT suitable for testing the explicit setting of alignment due to its reliance on system-dependent default alignments, which led to failures in the CI. To properly verify alignment settings, `test_Record_TYPEATTR` is added. `test_Record_TYPEATTR` explicitly sets alignment to `1` for a `TKIND_RECORD` containing `char` and `double` fields. This ensures the record's `cbAlignment` and `cbSizeInstance`, guaranteeing consistent behavior across 32-bit and 64-bit systems. This test demonstrates the correct usage of `SetAlignment` for platform-independent layout.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request refactors and expands the test suite for type library creation and type information management.
Existing tests for
ICreateTypeLibandICreateTypeInfohave been moved to a new, dedicated filetest/test_typeinfo_create.py, improving test organization and maintainability.Enhanced Test Coverage
Comprehensive
ICreateTypeLib2andITypeLib2VerificationPreviously, tests for
CreateTypeLibcovered basic documentation and library attributes.This change introduces an expanded set of tests for
ICreateTypeLib2.Detailed
ICreateTypeInfoStructure and Documentation ValidationThe
ICreateTypeInfotesting has been improved to cover various aspects of type information creation.This now includes dedicated tests for
ITypeInfo.GetDocumentationfor functions and variables,TYPEATTRverification for interfaces and aliases,FUNCDESCandVARDESCvalidation,IMPLTYPEFLAGfor coclasses, andDllEntryverification.Improved Test Maintainability and Discoverability
By moving tests related to type library creation and modification into their own module
test_typeinfo_create.py.