cannot run tests if use environment variable in output directory"

Issue #124 resolved
Евгений Савин created an issue

”Run tests” button are disabled. And TestInsightSettings.ini is not created.

Delphi 10.2

Comments (6)

  1. Stefan Glienke repo owner

    Make sure to tick the “TestInsight project” item in the project manager context menu. That enables TI for the project, any output directories have nothing to do with that.

  2. Евгений Савин reporter

    Well, maybe bug is not about env. variables.

    Steps to reproduce:

    Click on main menu: File/New/Other/Console Application

    Main menu: Project/Options, set output directory to $(SystemDrive)/Temp (I assume, this directory exists) and add TESTINSIGHT to defines

    Change project file to this:

    program Project1;
    
    {$APPTYPE CONSOLE}
    
    {$R *.res}
    
    uses
      System.SysUtils, TestInsight.DUnit;
    
    begin
      RunRegisteredTests();
    end.
    

    Add new unit:

    unit Unit2;
    
    interface
    
    uses
      SysUtils, TestFramework;
    
    type
      TTests = class(TTestCase)
      published
        procedure Test;
      end;
    
    implementation
    
    { TTests }
    
    procedure TTests.Test;
    begin
      raise Exception.Create('Error Message');
    end;
    
    initialization
      RegisterTest(TTests.Suite);
    
    end.
    

    Now all “run tests” in test insight explorer are disabled.

  3. Stefan Glienke repo owner

    TESTINSIGHT needs to be defined in the “All configurations - All platforms” target. Or simply use the entry in the context menu.

  4. Евгений Савин reporter

    TESTINSIGHT needs to be defined in the “All configurations - All platforms” target.

    Ok. Thanks

  5. Log in to comment