VSoftTechnologies / DUnitX

Delphi Unit Test Framework
Apache License 2.0
381 stars 198 forks source link

DUnitX.Tests.Utils' TValueHelperTests.Create not called in D2010 #298

Closed AntoineGS closed 2 years ago

AntoineGS commented 3 years ago

I was trying to get the tests to pass on D2010 and noticed that the TValueHelperTests.Create never gets called in D2010 (confirmed working in Berlin but it calls the constructor differently; using RTTI). FFixtureInstance := FTestClass.Create; gets called from DUnitX.TestFixture and FTestClass does resolve to TValueHelperTests. TObject.Create does get called though. I've tried using reintroduce on the constructor that has also not worked. It seems like using TClass does not work with reintroduced constructors so this might be one of those things. Overriding AfterConstruction works fine.

Someone has an idea of a different approach?

Thanks!

vincentparrett commented 2 years ago

D2010 has some challenges with compiler issues, especially around generics and RTTI/TValue. I no longer have D2010 installed - FWIW I'm setting the min supported version for all my open source projects to XE2 due to those issues in earlier versions.

AntoineGS commented 2 years ago

Thanks I'll simply use the other options (using [SetupFixture] and AfterConstruction).