exec builder does not capture the return value of the called batch file on windows

[email protected]
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <OF9FAC44ED.97977CAE-ON80257862.004097F5-80257862.0040CC7C@Selex-Comms.com>
I have searched the mail list archive and not found anything relating 
to this, but the exec builder does not appear to capture the return 
value of the called batch file on windows. I believe this is a 
fault/special odd behaviour of windows command shell.

If I write an exec builder thusly:

<schedule interval="5">
   <exec 
      command="R:\software\scripts\utils\cruise-control\always-fails.bat"
      workingdir="R:\software\"
      args="> R:\output-vc90\artifact.txt"/>
</schedule>

and the batch file so:

echo I is broken
exit /B 100

even tho the documentation says:

<exec>
Runs a specified command or script as part of the build. Reports build 
failure if the command cannot be run or returns an error. 

the project will always report success. Now if you want to use the
return values of your scripts rather search for the <errorstr> this 
is a bit disabling. I found that things are fixed if the command is
forced to evaluate a string, so adding & exit will make it work. So:

<schedule interval="5">
   <exec 
      command="R:\software\scripts\utils\cruise-control\always-fails.bat"
      workingdir="R:\software\"
      args="> R:\output-vc90\artifact.txt" &amp; exit/>
</schedule>

Maybe the " &amp; exit" could be added under the covers by cruise if it's
not already there to make the exec builder behave as it's documentation on 
windows.

This would fix such problems as reported at;
http://markmail.org/message/xhwi5qluufkeyrom

This was a real b*gger to find so I hope others will get benefit.

Martin
--
Martin Yarwood                        Chief Engineer SENTINEL,  C++ 
development.  XCH 8555
Selex Communications                       Grange Road, Christchurch , 
Dorset  BH23 4JE, UK
 +44(0)1202-408555      fax 408888 [email protected]
Selex Intranet http://www.uk.mobile.marconi.com/home/index.php
Company KnowledgeBase http://wiki.uk.mobile.marconi.com/
Sentinel Wiki                 http://pvcs001:8890/sentinel/wiki


-----------------------------------------------
This email and any attached files contains company confidential information which may be legally privileged.  it is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein.  If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies.  It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar

_______________________________________________
Cruisecontrol-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
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.