keep getting errorlevel 0 returned when i compare two different folders !?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pault
    New User
    • May 2015
    • 2

    keep getting errorlevel 0 returned when i compare two different folders !?

    I am trying to diff two folders using the below batch file and script but I am always getting 0 back in the errorlevel.

    Its runs ok and the compare.csv contains the diffs ... but I keep getting errorlevel 0 when I run from the command line OR via the batch file

    I have googled this and tried suggestions for a few hours but got nowhere and its driving me nuts!

    Great if anyone could help!

    Thanks alot

    Paul


    Dos output ...
    ------------------------------------------------------------------------

    C:\paul\Projects\205_regression_testing\prod_rerun \02_cases>bcomp.com @test.bcmpbat
    C:\paul\Projects\205_regression_testing\prod_rerun \02_cases>echo %errorlevel%
    0
    C:\paul\Projects\205_regression_testing\prod_rerun \02_cases>

    ------------------------------------------------------------------------

    My script file contains ...

    ------------------------------------------------------------------------
    load "production_cases" "rerun_cases"
    expand all
    criteria rules-based
    filter "QuoteOutput*.xml"
    folder-report layout:side-by-side options:display-mismatches output-to:".\compare.csv"
    ------------------------------------------------------------------------

    ------------------------------------------------------------------------
    @echo off

    bcomp.com @test.bcmpbat
    set ERRLVL=%errorlevel%

    if %ERRLVL% EQU 2 (
    goto :PROBS
    )
    if %ERRLVL% EQU 1 (
    goto IFFS
    )
    if %ERRLVL% EQU 0 (
    goto :OKOK
    )

    :OKOK
    echo "folders matched"
    goto :EOF

    IFFS
    echo "folders had diffs"
    goto :EOF

    :PROBS
    echo "error : problem with diffs"
    goto :EOF


    :EOF
    ------------------------------------------------------------------------
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Hello,

    The Return codes listed in our Command Line reference article is a full list of all return codes, but Scripting on uses a subset of these. "0" is a Successful script run. We don't return if the folders have differences as a return code; those codes are for file pairs compared using the /quickcompare command line, which is independent of scripting.

    To determine if folders have differences, you would need to generate a folder-report and parse it for the needed information. As one example, you could generate an XML report of only differences to determine if differences are present.
    Aaron P Scooter Software

    Comment

    • pault
      New User
      • May 2015
      • 2

      #3
      Originally posted by Aaron
      Hello,

      The Return codes listed in our Command Line reference article is a full list of all return codes, but Scripting on uses a subset of these. "0" is a Successful script run. We don't return if the folders have differences as a return code; those codes are for file pairs compared using the /quickcompare command line, which is independent of scripting.

      To determine if folders have differences, you would need to generate a folder-report and parse it for the needed information. As one example, you could generate an XML report of only differences to determine if differences are present.
      Aaron, that makes sense, thanks for the reply!

      Comment

      Working...