Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4273082
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:39:53+00:00 2026-05-21T07:39:53+00:00

What tools would you recommend for unit testing in Delphi. I’ve used FastMM4 for

  • 0

What tools would you recommend for unit testing in Delphi.
I’ve used FastMM4 for memoryleak testing.
And MadExcept, both rule, but it doesn’t help me test the logic in my programs.
I would like some alternatives, so don’t all rush to suggest DUnit :-).

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:39:54+00:00Added an answer on May 21, 2026 at 7:39 am

    You could take a look at the unit testing classes available in our SynCommons open source unit. It’s used in our Open-Source framework for all regression tests. It’s perhaps not the best, but it’s worth taking a look at it. See http://blog.synopse.info/post/2010/07/23/Unit-Testing-light-in-Delphi

    In the up-to-come 1.13 version, there is also a new logging mechanism with stack trace of any raised exception and such, just like MadExcept, using .map file content as source.

    It’s now used by the unit testing classes, so that any failure will create an entry in the log with the source line, and stack trace:

    C:\Dev\lib\SQLite3\exe\TestSQL3.exe 0.0.0.0 (2011-04-13)
    Host=Laptop User=MyName CPU=2*0-15-1027 OS=2.3=5.1.2600 Wow64=0 Freq=3579545
    TSynLogTest 1.13 2011-04-13 05:40:25
    
    20110413 05402559 fail  TTestLowLevelCommon(00B31D70) Low level common: TDynArray "" stack trace 0002FE0B SynCommons.TDynArray.Init (15148) 00036736 SynCommons.Test64K (18206) 0003682F SynCommons.TTestLowLevelCommon._TDynArray (18214) 000E9C94 TestSQL3 (163) 
    

    The difference between a test suit without logging and a test suit with logging is only this:

    procedure TSynTestsLogged.Failed(const msg: string; aTest: TSynTestCase);
    begin
      inherited;
      with TestCase[fCurrentMethod] do
        fLogFile.Log(sllFail,'%: % "%"',
          [Ident,TestName[fCurrentMethodIndex],msg],aTest);
    end;
    

    The logging mechanism can be used to trace recursive calls. It can use an interface-based mechanism to log when you enter and leave any method:

    procedure TMyDB.SQLExecute(const SQL: RawUTF8);
    var ILog: ISynLog;
    begin
      ILog := TSynLogDB.Enter(self,'SQLExecute');
      // do some stuff
      ILog.Log(sllInfo,'SQL=%',[SQL]);
    end; // when you leave the method, it will write the corresponding event to the log
    

    It will be logged as such:

    20110325 19325801  +    MyDBUnit.TMyDB(004E11F4).SQLExecute
    20110325 19325801 info   SQL=SELECT * FROM Table;
    20110325 19325801  -    MyDBUnit.TMyDB(004E11F4).SQLExecute 
    

    Here the method name is set in the code (‘SQLExecute’). But if you have an associated .map file, the logging mechanism is able to read this symbol information, and write the exact line number of the event.

    Note that by default you have time and date written to the log, but it’s also possible to replace this timing with high-resolution timestamps. With this, you’ll be able to profile your application with data coming from the customer side, on its real computer. Via the Enter method (and its auto-Leave feature), you have all information needed for this. 😉

    Like this:

    0000000000000B56  +    TTestCompression(00AB3570).000E6C79 SynSelfTests.TTestCompression.TestLog (376) 
    0000000000001785  -    TTestCompression(00AB3570).000E6D09 SynSelfTests.TTestCompression.TestLog (385) 
    

    I still need to write some tool to compute the profiling, but there is already a dedicated TSynLogFile class able to read the .log file, and recognize its content.

    The first time the .map file is read, a .mab file is created, and will contain all symbol information needed. You can send the .mab file with the .exe to your client, or even embed its content to the .exe. This .mab file is optimized: a .map of 927,984 bytes compresses into a 71,943 .mab file.

    So this unit could be recognized as the natural child of DUnit and MadExcept wedding, in pure OpenSource. 🙂

    Additional information is available on our forum. Feel free to ask. Feedback and feature requests are welcome! Works from Delphi 6 up to XE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What frameworks and tools would you recommend for unit-testing and mock objects in Perl?
Which set of libraries and tools would you recommend to use for development SOAP-service
I would like to hear what web UI testing tools you have found to
Would you happen to know of any tools that can be used to find
Until now, I've used an improvised unit testing procedure - basically a whole load
Which NetBeans plug-ins or tools would you recommend for JSF development?
What tools and procedures would you recommend or use yourself to help streamline the
What tools would you recommend for setting up CI for build and deployment of
Are there any tools you would recommend for site architecture design and analysis? I've
What simple tools would you recommend to read a text file of addresses, send

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.