-
Notifications
You must be signed in to change notification settings - Fork 315
Description
For VBA-Build, I was curious to see if it was possible to install Rubberduck inside a GitHub Action worker and run the tests inside a VBA project. The installation part worked, but as discussed in #5995, there is no way to access Rubberduck's method from the CLI at the moment.
However, looking in the code, there is currently this comment in TypeLibsAPI.cs:
Rubberduck/Rubberduck.VBEEditor/ComManagement/TypeLibs/Public/TypeLibsAPI.cs
Lines 15 to 35 in c417164
| { | |
| /// <summary> | |
| /// FOR DEBUGGING/DEVELOPMENT PURPOSES, ALLOW ACCESS TO SOME VBETypeLibsAPI FEATURES FROM VBA | |
| /// </summary> | |
| /// <remarks> | |
| /// VBA Usage example: | |
| /// With Application.VBE.Addins("Rubberduck.Extension").Object | |
| /// .ExecuteCode("ProjectName", "ModuleName", "ProcedureName") | |
| /// End With | |
| /// </remarks> | |
| [ | |
| ComVisible(true), | |
| Guid(RubberduckGuid.DebugAddinObjectInterfaceGuid), | |
| InterfaceType(ComInterfaceType.InterfaceIsDual), | |
| EditorBrowsable(EditorBrowsableState.Always) | |
| ] | |
| public interface IVBETypeLibsAPI_Object | |
| { | |
| [DispId(1)] | |
| bool CompileProject(string projectName); | |
| [DispId(2)] |
And this suggests to me that if the TypeLibsAPI was available in the release build or an alternative build, it would be possible to acess certain Rubberduck methods via VBA/COM directly. Then, it would be possible to write some kind of wrapper around the RunAllTestsCommand to return the outcome of the tests as a text file that could be used by the CLI.
eg.:
Dim Output As String
With Application.VBE.AddIns("Rubberduck.Extension").Object
Output = .RunAllTests()
End With
' Then write output to text file...Does that sounds like a reasonable idea? I could try to work on this.
