[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{}}}{{{{}}{}}}
{{It's a bit messier in build.bat, which has a couple of paths to :end, but not hard. (Also, build.bat should really be using setlocal/endlocal rather than counting on setting and clearing _whatever variables, but that's nitpicking.)}}
{{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{}}}{{{}{}}}
> 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
>
> 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{}}}{{{{}}{}}}
> {{It's a bit messier in build.bat, which has a couple of paths to :end, but not hard. (Also, build.bat should really be using setlocal/endlocal rather than counting on setting and clearing _whatever variables, but that's nitpicking.)}}
> {{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)