VBCorLib icon indicating copy to clipboard operation
VBCorLib copied to clipboard

VBCorTests project failures

Open bryceschober opened this issue 5 years ago • 9 comments

I'm submitting a bug report

Library Version: git master@e12acb5

Please tell us about your environment:

  • Operating System: Windows 10 & VB6 IDE
  • Installed https://github.com/kellyethridge/SimplyVBUnit/releases/tag/v5.0 from .exe

Current behavior:

  1. When I build the project group, or also just the VBCorTests project, after successfully building the Source\CorLib\VBCor3.dll and the Source\Fakes\Fakes.dll, I get a compilation error in trying to build the VBCoreTests project:

    Compile error: Variable uses an Automation type not supported in Visual Basic And it highlights the phrase GuidToUse As Guid on line 120 of GuidTests.cls.

  2. When I try the "Run with full compile" command on the VBCorTests project, I get a different error:

    Object library not registered

  3. When I try to just "Run" the VBCorTests project, I get yet a different error:

    Compile error: Method or data member not found

Expected/desired behavior:

I want to be able to run the test suite to validate that I have a good compilation of the current git master dll.

Am I missing a dependency somewhere? Do I need to register the .dlls that I've built?

bryceschober avatar May 30 '19 22:05 bryceschober

FWIW, I just noticed that l the IDE did update my .vbp files so that they no longer had relative path references, and they were replaced with relative paths to the dll files.

bryceschober avatar May 30 '19 23:05 bryceschober

Bah, I just realized that I hadn't registered the TypeLib\CorType.tlb and VBVM6Lib.tlb. After doing that from an elevated shell, I get:

image

And it drops me into GuidTests.cls at line 86, in the "Equals_WithNonGuidValues_ReturnsFalse" test case.

bryceschober avatar May 30 '19 23:05 bryceschober

@kellyethridge Any ideas on why I might not be able to run your unit test suite? I'm still blocked on the most recently reported problem.

bryceschober avatar Jun 05 '19 17:06 bryceschober

HI,

Sorry about the delay. I don't get much time for this.

Anyways, to the Guid issue at the top of this thread. It's most likely because the VBCorLib Guid is in a naming conflict and the reference to VBCorLib needs to be moved up in priority in references.

I'm not sure was the Error 91 is coming from, I'll have to look more in to that. I did however find an issue with SimplyVBUnit that will cause tests to fail with a compiled VBCorLib that will be addressed.

kellyethridge avatar Jun 06 '19 19:06 kellyethridge

For whatever reason, after installing the latest SimplyVbUnit v5.0.1, I can now run the test runner successfully... And I get 11 of failing tests. I assume this isn't expected, and I'd love to report them, but I'm not sure how I'd get the results out of the test runner app...

FWIW, most of the failures are directory-related and seem to be triggered by my project living under my e:\.

bryceschober avatar Jun 11 '19 14:06 bryceschober

I'm glad the tests are actually running now. As for capturing the output of the tests I've been using a logger class. I've included it as an attachment. You will need to change the extension back to cls. I added it in the From_Initialize event of the test runner.

Private Sub Form_Initialize()
    Me.UIRunner1.Init App
    Me.UIRunner1.AddListener New OutputLogger
End Sub

This will generate a log file of errors and failing tests. OutputLogger.txt

kellyethridge avatar Jun 11 '19 19:06 kellyethridge

I, too, am having failed tests but I think I understand the nature of the problem - I think the root of all of them is this:

CorLib.Tests.System.TimeZoneTests.Constructor_WhenCalled_ReturnsExpected: Time zone 'US Mountain Standard Time' is not supported by tests.

I'm in Phoenix and am definitely using US Mountain Standard Time as my timezone (we're in the small minority that ignores DST changes) We're GMT-7 year round.

BluejacketScott avatar Jun 01 '20 04:06 BluejacketScott

@kellyethridge I sent you a pull request for US MST issues. Only one left:

EnvironmentTests.GetCommandLineArgs_WhenCalled_ReturnsArgs failed: Expected: 2 but Was: 1

It might have more to do with the way I'm running the tests. I'm loading up the CorLib.Solution.vbg in the Source directory. Is that the problem? Is there a better way to load up so as to avoid this issue?

BluejacketScott avatar Jun 01 '20 06:06 BluejacketScott

Found the reason for my above error. Opening VB6 first, and then browsing and opening CorLib.Solution.vbg means that the command line arguments only contain one element: the VB6.exe. However, if one were to close VB6 and double-click CorLibSolution.vbg instead, the test passes. PR submitted.

BluejacketScott avatar Oct 18 '20 20:10 BluejacketScott