Repository navigation
Release 0.11.0 - #103
Merged
Merged
Release 0.11.0#103
Conversation
This reverts commit 9b3f4dc. The MCP server runs the tests through the AccUnitLoader test suite inside Access and does not need the setter.
Add MCP server for AccUnit tests
Start with accunit_generate_test_class and do not read the source of the module under test; ask the developer once how to handle behavior that cannot be derived. Use the VBA error number for Assert.Throws, restrict Ignore to open expected behavior and note explicit skill invocation.
Import test classes and test related modules from source files with the import of the AccUnit core, so writing tests no longer depends on msaccess-vcs. Files are converted to the ANSI code page, get the class export header if missing and are saved with DoCmd.Save to avoid the Save As dialog on quit. Modules that are not test modules are never replaced. The draft returns the AccUnit test folder.
Refuse an Access instance that was already running before the server requested one and release it without quitting. Quit the own instance and report an error when OpenCurrentDatabase returns without opening the database, which was seen while another Access automation was running.
accunit_export_test_classes and accunit_remove_test_classes work only on test modules and keep files they write over as .bak. The skill now creates a second test class first and asks the developer whether to merge it, replace the existing class or keep both.
Guard MCP server against foreign or unopened Access instances
…est-classes MCP server: accunit-tests skill and tools to import, export and remove test classes
VBComponent.Export and VBComponents.Import always use the ANSI code page. The core now rewrites exported .cls/.bas files as UTF-8 with BOM (new setting ImportExportEncoding: Utf8Bom (default) or Ansi) and imports an ANSI copy with CRLF of each source file. The import detects UTF-8 with or without BOM, otherwise ANSI, and rejects all files if one contains characters not available in the ANSI code page.
…s-files Export test classes as UTF-8 with BOM and detect encoding on import
Reading, encoding check and ANSI conversion of test class files now use VbaSourceFile of the AccUnit core. The import copy is written as UTF-8 with BOM; the core converts it for VBComponents.Import. Export docs name the ImportExportEncoding setting.
…urce-file Use core VbaSourceFile in MCP server import
Combo box with UTF-8 with BOM (0) and ANSI (1) below ImportExportFolder; the form loads and saves the value through IUserSettings.ImportExportEncoding.
…t-export-encoding Add ImportExportEncoding to Access add-in settings form
…r-suite Expose CodeCoverageTracker on IAccessTestSuite
… exit The click event sinks of the VBE command bar buttons were never removed (unsubscribe was disabled for issue #77). The CLR finalizer then unadvised them during process shutdown, after the VBE was gone, which crashed Access (access violation in combase.dll/clr.dll). Office crash recovery restarted Access, leaving an empty Access window. Remove the click handlers in Dispose (not from the finalizer) before the AccUnit command bars are deleted, and unsubscribe the AccUnit sub menu CommandBarEvents in TestStarter. Buttons are still not deleted.
…cess-instance Fix Access crash on exit caused by VBE add-in command bar events
Finalizers run on the finalizer thread, possibly during process exit when the STA is gone (same class of bug as the crash fixed in #98). - Remove the finalizers of VbeCommandBarAdapter, OfficeApplicationHelper, Connect, AddInManager and AccessErrorTrappingObserver; COM objects are only released in Dispose(true) (OnDisconnection/OnBeginShutdown). AccessErrorTrappingObserver restores the error trapping on Dispose only. - ComTools: look up the file moniker in the ROT instead of Marshal.BindToMoniker (no activation of a new Access instance), check the result against the VBE, release non-matching candidates, ROT helper objects and the IUnknown/QueryInterface pointers. - HotKey/HotKeys: unregister hot keys on Dispose instead of in the finalizer (registration is still disabled, issue #78).
Remove COM access from finalizers and release COM objects in host lookup
- Release the AddIn RCW only in Connect (AddInManager no longer releases it) - Dispose the previous OfficeApplicationHelper when the host application is re-initialized - ComTools: continue with the ROT search if GetActiveObject fails; skip faulty ROT entries - OfficeApplicationHelper: fix inverted condition in GetCheckedVbProject - Add unit tests for the project lookup condition and the unregistered ProgID case
…owup Fix COM ownership and host lookup issues found in #99
Clear(string codeModuleName = null) threw a NullReferenceException for the default value. Null or empty now clears all modules. Clear(name) also removes the module from the tracker, so the report no longer lists it.
TestSuiteManager.InitTestSuite only showed the exception and returned a null suite, so VBA failed later with a meaningless message. The exception is now logged and rethrown as InvalidOperationException with the original message; UI callers already show exceptions themselves. TestSuiteInitialized is raised only on success.
Fix CodeCoverageTracker.Clear and silent null from TestSuiteManager
AccUnit.dll 0.11.0.0, AccessCodeLib.Common.VBIDETools 0.9.20.0 (Common.Tools unchanged at 0.9.11.0), VBE add-in 0.11.0000.0, Access add-in 0.11.0000.261118.
Release 0.11.0: bump versions
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
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.
Merge dev into main for release 0.11.0.