[jira] [Updated] (XALANJ-2821) xalan-test build scripts should return success code from the (currently ant) build run

"Joe Kesselman (Jira)" <[email protected]>
Newsgroups gmane.text.xml.xalan.devel
Message-ID <[email protected]>
     [ https://issues.apache.org/jira/browse/XALANJ-2821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Kesselman updated XALANJ-2821:
----------------------------------
    Description: 
Flaw in build.sh (probably build.bat too) : The script does not return the exit code from the ant run, which makes checking the result of a test invoked programmatically annoying at best.

The problem is that ant is not the last command run; there's a final
{{  echo "build.sh complete!"}}
which will always set $? (linux) or  %ERRORLEVEL% (windows) to 0, the success value.
 
This is easily fixed by saving the build's exit code and having the script return that. For example, in build.sh, we could change that last line to:
{{  ant_rc=$?}}
{{  echo "build.sh complete with return code" $ant_rc}}
{{  exit $ant_rc}}

{{Equivalent of $? in Windows .bat/.cmd files is %ERRORLEVEL%.}}

{{Similar changes may want to be applied to build.sh/build.bat in xalan-java.}}

  was:
Flaw in build.sh (probably build.bat too) : The script does not return the exit code from the ant run, which makes checking the result of a test invoked programmatically annoying at best.

The problem is that ant is not the last command run; there's a final
{{  echo "build.sh complete!"}}
which will always set $? (linux) or  %ERRORLEVEL% (windows) to 0, the success value.
 
This is easily fixed by saving the build's exit code and having the script return that. For example, in build.sh, we could change that last line to:
{{{}  ant_rc=$?{}}}{\{  }}
{{  echo "build.sh complete with return code" $ant_rc}}
{{{}  exit $ant_rc{}}}{{{{}}{}}}

{{Equivalent of $? in Windows .bat/.cmd files is %ERRORLEVEL%.}}

{{Similar changes may want to be applied to build.sh/build.bat in xalan-java.}}


> xalan-test build scripts should return success code from the (currently ant) build run
> --------------------------------------------------------------------------------------
>
>                 Key: XALANJ-2821
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2821
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in Xalan projects.  Anybody can view the issue.) 
>          Components: Xalan
>            Reporter: Joe Kesselman
>            Priority: Minor
>              Labels: build, scripts, test
>
> Flaw in build.sh (probably build.bat too) : The script does not return the exit code from the ant run, which makes checking the result of a test invoked programmatically annoying at best.
> The problem is that ant is not the last command run; there's a final
> {{  echo "build.sh complete!"}}
> which will always set $? (linux) or  %ERRORLEVEL% (windows) to 0, the success value.
>  
> This is easily fixed by saving the build's exit code and having the script return that. For example, in build.sh, we could change that last line to:
> {{  ant_rc=$?}}
> {{  echo "build.sh complete with return code" $ant_rc}}
> {{  exit $ant_rc}}
> {{Equivalent of $? in Windows .bat/.cmd files is %ERRORLEVEL%.}}
> {{Similar changes may want to be applied to build.sh/build.bat in xalan-java.}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.