Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Unit Testing/Test Projects    [ Add a report in this area ]  
Report #:  43201   Status: Closed
New unit tests don't compile
Project:  Delphi Build #:  11.0.2627.5503
Version:    11.0 Submitted By:   Danny Heijl
Report Type:  Minor failure / Design problem Date Reported:  3/25/2007 6:47:55 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   249248
Resolution: Retest (Resolution Comments) Resolved in Build: : 15.0.3948.35086
Duplicate of:  None
Voting and Rating
Overall Rating: (3 Total Ratings)
5.00 out of 5
Total Votes: 1
Description
If you add a new test project and add a new test case, you can't compile the test case, because the IDE adds ";$(BDS)\Source\DUnit\src" to the search path, and the unit "TestFrameWork.pas" does not compile :

[DCC Error] TestFramework.pas(687): F1026 File not found: 'FastMMMemLeakMonitor.dcu'

Clearing the search path in project options, so that the compiler no longer uses the Dunit source code, fixes it.
Steps to Reproduce:
- create a new Win32 VCL forms project
- add a button and a non-empty buttonclick event
- save and build
- add a new Dunit test project to the project group
- add a new Dunit test case for the form above to the test project
- try to compile this new test project

expected: the test project compiles

actual:

compiler error:

[DCC Error] TestFramework.pas(687): F1026 File not found: 'FastMMMemLeakMonitor.dcu'


Reason: the IDE adds ";$(BDS)\Source\DUnit\src" to the search path in the projects options, so that the compiler uses the Dunit source which does not compile in this configuration.

Work-around: remove the DUnit source code path from the project search path.

Full compiler messages below:

c:\program files\codegear\rad studio\5.0\bin\dcc32.exe -DDEBUG;_CONSOLE_TESTRUNNER -I;"c:\program files\codegear\rad studio\5.0\Source\DUnit\src";"c:\program files\codegear\rad studio\5.0\lib";"c:\program files\codegear\rad studio\5.0\Imports";"c:\program files\codegear\rad studio\5.0\Lib\Indy10";"C:\Documents and Settings\All Users\Documenten\RAD Studio\5.0\Dcp";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\VTSourceOnly\Source";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\TNT\Source";"c:\program files\codegear\rad studio\5.0\packages" -LE"C:\Program Files\CodeGear\RAD Studio\5.0\Packages" -LN"C:\Program Files\CodeGear\RAD Studio\5.0\Packages" -M -NS; -O;"c:\program files\codegear\rad studio\5.0\Source\DUnit\src";"c:\program files\codegear\rad studio\5.0\lib";"c:\program files\codegear\rad studio\5.0\Imports";"c:\program files\codegear\rad studio\5.0\Lib\Indy10";"C:\Documents and Settings\All Users\Documenten\RAD Studio\5.0\Dcp";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\VTSourceOnly\Source";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\TNT\Source";"c:\program files\codegear\rad studio\5.0\packages";"c:\program files\codegear\rad studio\5.0\lib";"c:\program files\codegear\rad studio\5.0\Imports";"c:\program files\codegear\rad studio\5.0\Lib\Indy10";"C:\Documents and Settings\All Users\Documenten\RAD Studio\5.0\Dcp";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\VTSourceOnly\Source";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\TNT\Source";"c:\program files\codegear\rad studio\5.0\packages" -R;"c:\program files\codegear\rad studio\5.0\Source\DUnit\src";"c:\program files\codegear\rad studio\5.0\lib";"c:\program files\codegear\rad studio\5.0\Imports";"c:\program files\codegear\rad studio\5.0\Lib\Indy10";"C:\Documents and Settings\All Users\Documenten\RAD Studio\5.0\Dcp";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\VTSourceOnly\Source";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\TNT\Source";"c:\program files\codegear\rad studio\5.0\packages" -U;"c:\program files\codegear\rad studio\5.0\Source\DUnit\src";"c:\program files\codegear\rad studio\5.0\lib";"c:\program files\codegear\rad studio\5.0\Imports";"c:\program files\codegear\rad studio\5.0\Lib\Indy10";"C:\Documents and Settings\All Users\Documenten\RAD Studio\5.0\Dcp";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\VTSourceOnly\Source";"C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\TNT\Source";"c:\program files\codegear\rad studio\5.0\packages" --no-config   "C:\Documents and Settings\HD\Mijn documenten\Borland Studio Projects\HighLander\tests\dp\Test\Project1Tests.dpr"  
[DCC Warning] TestFramework.pas(525): W1055 PUBLISHED caused RTTI ($M+) to be added to type 'TAbstractTest'
[DCC Warning] TestFramework.pas(566): W1055 PUBLISHED caused RTTI ($M+) to be added to type 'TTestCase'
[DCC Error] TestFramework.pas(687): F1026 File not found: 'FastMMMemLeakMonitor.dcu'
Workarounds
Remove the DUnit source code path from the project search path.

This way the Dunit source is no longer used and everything is fine.
Attachment
None
Comments

Mikael Eriksson at 3/25/2007 9:44:47 AM -
When using TestFramework.dcu the test projects compile but when using TestFrameWork.pas FastMMMemLeakMonitor.pas is missing.

There are some files missing in $(BDS)\source\dUnit compared to the download from SourceForge (see below).

A lot of files are also modified. There are only changes in comments and added TODO items.
The name Juanco A ez is consequently changed to Juanco Aez.

regards

/Micke

Contrib\DUnitWizard\README.rtf
Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject\dunit_project.bmp
Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject\dunit_project16.ico
Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject\dunit_project256.ico
Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject\dunit_testclass.bmp
Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject\dunit_testmodule.bmp
Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject\dunit_testmodule16.ico
Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject\dunit_testmodule256.ico
Contrib\XPGen\Makefile
doc\DUNIT.CNT
doc\DUNIT.HLP
doc\images\xtao.cdr
doc\tutorial.doc
etc\versioninfo.template.inc
etc\versioninfo.template.rc
examples\Checkless Tests\
examples\HaltRepeating\
examples\MemLeakDetect\
readme-9.3.txt
readme-fastmm.txt
src\DUnit4Net.bdsgroup
src\DUnitW32.bdsgroup
src\DUnitW32.dpr
src\FastMMMemLeakMonitor.pas
tests\DUnitTestLibW32.bdsproj
tests\DUnitTestLibW32.dpr
tests\FastMMMonitorTest.pas
tests\Makefile





Mikael Eriksson at 3/25/2007 9:45:32 AM -
TestFramework.pas provided is obviously not used to compile lib\TestFramework.dcu.

The code below, from a previous thread, to remove compiler warnings is present in TestFramework.dcu but not in TestFramework.pas.

{$M+}
  TTestCase     = class;
{$M-}

Server Response from: ETNACODE01