0
Fixed

Command line client always exits with zero

Lübbe Onken 10 years ago updated by Roman 10 years ago 8
This happens with FixInsightCL version 2015.02upd1

I call the command line client from a NAnt script. The intention is to fail the build when a file can not be parsed by FixInsight.

For debugging purposes I currently capture the exit code in a result property and print it to the console.
  • When I introduce a parser error in the .dpr file (e.g. insert '###' in any line), FixInsightCL reports "Failed to parse <file>.dpr", but still exits with zero. Would have expected exit code 1 or 2 here.
  • When I introduce a parser error in any of the project files, Fixinsight writes "<file>.pas Fatal parser error" into the log file and exits with zero. Would have expected exit code 1 here.
Under review
Could you please do a simple test for me? Please create a FixInsightTest.bat and run it. It will output the ExitCode.

@fixinsightCL.exe --project=C:\Path\To\SomeBrokenProject.dpr
@echo Exit Code:
@echo %errorlevel%
pause
This works fine for me. I just want to make sure that we are talking about the same problem.
Unfortunately the same result in both cases. The output of the batch script with the invalid .dpr is:
Failed to parse xxxxx.dpr
Exit Code:
0
How do you return the exit code? In my command line application (compiled with XE2) I return it the following way:
Which means I exit with zero in case of an exception... Have to fix that :)

begin
    try
      ...

      analyzer := TLogAnalyzer.Create;
      ExitCode := Analyzer.Analyze(parser);

    except
      ...
    end;
end.
Hm, this is strange. I will do more tests.
The smalles dpr which returns a zero exit code plus a "failed to parse" message is this one:
program Defekt;
###
begin
end.
Are you sure you use the latest build?
This is the one installed with your upd01 setup from the web site. It says:
FixInsightCL version 2015.02upd1.
There is no version Info shown in Windows explorer.