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 8572017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:54:40+00:00 2026-06-11T18:54:40+00:00

I use DUnit. It has an VCL GUITestRunner and a console TextTestRunner. In an

  • 0

I use DUnit. It has an VCL GUITestRunner and a console TextTestRunner.

In an unit used by both Firemonkey and VCL Forms applications I would like to achieve the following:

  1. If Firemonkey app, if target is OS X, and executing on OS X -> TextTestRunner
  2. If Firemonkey app, if target is 32-bit Windows, executing on Windows -> AllocConsole + TextTestRunner
  3. If VCL app -> GUITestRunner
{$IFDEF MACOS}
TextTestRunner.RunRegisteredTests;      // Case 1
{$ELSE}
   {$IFDEF MSWINDOWS}
   AllocConsole;
   {$ENDIF}
   {$IFDEF FIREMONKEY_APP}              // Case 2 <--------------- HERE
   TextTestRunner.RunRegisteredTests;  
   {$ELSE}                              // Case 3
   GUITestRunner.RunRegisteredTests;
   {$IFEND}
{$ENDIF}

Which is the best way to make Case 2 work?

  • 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-06-11T18:54:41+00:00Added an answer on June 11, 2026 at 6:54 pm

    There are no built in conditionals that tell you whether the project’s FrameworkType, as specified in the .dproj file, is VCL or FMX. To the very best of my knowledge you cannot switch on that setting in code. Remember also that it is perfectly possible, although certainly not mainstream, to have an application that uses both VCL and FMX. It’s really not an either or condition.

    So I recommend that you declare your own conditional define that controls whether you use the GUI runner or the text runner.

    In fact, you presumably already have some sort of a mechanism to do this. You code names the unit GUITestRunner. So that means it must be in a uses in the same file as the code in the question. How did you conditionally include GUITestRunner in the uses clause?

    Note: The same question has been asked on the Embarcadero forums: https://newsgroups.embarcadero.com/message.jspa?messageID=400077

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

Sidebar

Related Questions

Is there any equivalent of DocTest for Delphi. I use DUnit but I like
I'm trying to use DUnit, which came with RAD Studio XE2, to unit testing
I'm attempting to set up my unit testing environment to use DbUnit. I'm having
I have a database process written in PL/SQL that i would like to test
I've seen some people use the maven-sql-plugin to do this. But it seems like
I have never used unit testing before, so I'm giving CxxTest a go. I
Are the same unit testing frameworks used for different web frameworks - Rails, Merb,
You can use TAbstractTest.Status procedure to show some debug messages in DUnit GUI during
I use dbunit to test db operations in my webapp.Recently ,I used dbunits ant
I use DbUnit for unit-testing of my DAO objects. It works great so far.

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.