It depends on what you consider a serious error.  You'll get an
exception if the process fails to start, but it's possible that you
start it and that it fails to load your test assembly.  It can also
happen that it won't find any tests, perhaps because the MbUnit.Cons
arguments are wrong.
 
So you should probably check the return code.  It will be non-zero when
a test failed or when no tests were found.
 
Jeff.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Leonid Lastovkin
Sent: Monday, November 12, 2007 3:05 PM
To: [email protected]
Subject: MbUnit Question about the exit code of MbUnit.Cons.exe


Hi,

I am sequentially launching several MbUnit.Cons.exe with proper
arguments from a C# app.
The pseudocode is like so:

01. Process proc = new Process();
02. // Prepare arguments
03. try {
04.     proc.Start();
05.     // grab the output and the exit code
06. } catch (All possible exceptions) {
07.     // Send an email notification
08. }
09. // If the exit code was no 0, then send email notification as well. 
10. Repeat steps 01. - 09. for the next job until there are no more
jobs.

==============================================

I am not sure about the last step (09) though. It ran 265 tests, 1 of
which failed and 6 of which were ignored. 
It generated all of the report files correctly, but still sent an email
notification, probably because the exit code was non-zero.

My question is: when is the exit code non-zero?           Is it:
* When some test(s) fail? 
* When some tests are being ignored?                        or maybe
also:
* When some other error occurs with MbUnit.Cons.exe?

I want the jobs to finish even if some tests fail,
unless there has been a serious problem, like running out of memory. 

So, would it be safe to ignore the exit code  (and hence remove step
09.)
and assume that any serious error would manifest itself as an exception?

I am currently catching Win32Exception, ObjectDisposedException,
InvalidOperationException, 
IOException, OutOfMemoryException and SystemException in step 06.

Thanks.




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to