🇬🇧 English — 🇩🇪 Deutsch
The DUnitX test suite (StaticCodeAnalyserForm\tests\TestProject.dproj) needs
two external components. Without them "Build all projects" fails with
F2613 Unit '...' not found.
| Component | Required | Purpose |
|---|---|---|
| DUnitX | required | Test framework (Assert / [Test] attributes / runner) |
| TestInsight | Win32 optional | IDE integration (test panel, live status) |
The actual SCA engine + standalone EXE run independently — the tests are only relevant for developers. If you only want to build the SCA, you can exclude the TestProject from the IDE build (see workarounds below).
cd D:\git-demos\delphi
git clone https://github.com/VSoftTechnologies/DUnitX.git dunitxIn TestProject.dproj the path ..\..\..\dunitx\Source is already in
DCC_UnitSearchPath (commit 3f1cab0). Different parent directory? Adjust the
path in the dproj or set it globally via Tools → Options → Language → Delphi →
Library (separately for Win32 and Win64).
Preferably via the GetIt Package Manager:
- RAD Studio IDE → Tools → GetIt Package Manager
- Search "TestInsight" → click Install
- Restart the IDE
GetIt sets the library path and installs the plugin automatically.
If the GetIt entry is missing: search GitHub/Bitbucket for
TestInsight Stefan Glienke, clone manually, compile + install the
TestInsight.RADxx.dpk, then add Source/ to the Win32 library path.
| Build target | Platform | Prerequisite |
|---|---|---|
| SCA.Engine.bpl | Win32 + Win64 | rtl, nothing external |
| SCA.SharedUI.bpl | Win32 only | rtl, vcl, designide (IDE-only) |
| StaticCodeAnalyser.exe (standalone) | Win32 + Win64 | nothing external |
| StaticCodeAnalyser.IDE.bpl | Win32 only | rtl, vcl, designide |
| TestProject.exe | Win32 + Win64 | DUnitX + (Win32: TestInsight) |
"Build all projects" builds all 5 targets on the currently selected platform.
Standard setup. The test panel shows live results; clicking a failing test jumps to the assertion.
Run TestProject.exe as a standalone console — the DUnitX console logger is used
(see TestProject.dpr lines 18-20):
".\Output\Tests\Win64 Release\TestProject.exe"Exit code 0 = all green. Failures appear as stdout + NUnit XML next to the EXE
(via DUnitX.Loggers.Xml.NUnit).
The DUnitX command line takes filters:
TestProject.exe --include:TTestUninitVar
TestProject.exe --exclude:TTestPerformanceIf the tests are not currently relevant and you only want to build the SCA, in
IDE → right-click the project group → Build order → uncheck
TestProject.dproj. "Build all projects" then skips that project.
Equivalently, comment out the TestProject entry directly in the .groupproj.
In TestProject.dproj the define is active only for Win32 (line 133):
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Define>TESTINSIGHT;$(DCC_Define)</DCC_Define>
</PropertyGroup>The Win64 build therefore skips the TestInsight imports automatically and does not need the plugin. If you do not want TestInsight at all, delete the entry.
Several tests deliberately raise exceptions (EFOpenError, Exception, etc.) to
verify error handling. The IDE debugger catches them and shows a dialog.
Workaround:
- In the dialog: check "Ignore this exception type" + continue
- Permanently: Run → Run Without Debugging (
Ctrl+Shift+F9) instead of F9 — the debugger then does not intervene at all - Selectively: Tools → Options → Debugger Options → Language Exceptions → add the exception class to the ignore list
Generic inference fails under Win64 when an untyped int literal + Integer are
combined. Fix: explicit type parameter Assert.AreEqual<Integer>(N, X.Count).
Already patched in 1209 places of the suite (commit 5f1661c). Mind this for new
tests.
StaticCodeAnalyserForm\tests\TestProject.dproj— test project configStaticCodeAnalyserForm\tests\TestProject.dpr— test runner codeStaticCodeAnalyserForm\tests\uTest*.pas— the individual test unitsHowTo_AddDetector.md— when a new detector + tests are to be createdHowTo_DetectorSelftest.md— dogfooding workflow for the SCA EXE