Ignore:
Timestamp:
Oct 28, 2007 10:36:08 AM (12 years ago)
Author:
jpfasano
Message:

Commit is to copy file from my window to linux box.
Starting to clean up code which checks for success of "make test" and unitTest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBcheckResult.py

    r718 r720  
    1111import NBprojectConfig
    1212
    13 
    1413#------------------------------------------------------------------------
    1514# Determine if a projects "make test" or unitTest ran successfully.
     
    1716# this function has specialized code for some projects.
    1817#------------------------------------------------------------------------
     18
     19def rc0( result, project ) :
     20  retVal = None
     21  # If the return code is not 0, then failure
     22  if result['returnCode'] != 0 :
     23    retVal = "Non-zero return code of "+str(result['returnCode'])
     24
     25def standardSuccessMessage(result,project) :
     26  retVal = None
     27  # Is the success message contained in the output?
     28  if result['stderr'].rfind("All tests completed successfully") == -1 and \
     29     result['stdout'].rfind("All tests completed successfully") == -1 :
     30    # Success message not found, assume test failed
     31    retVal = "The output does not contain the messages: 'All tests completed successfully'"
     32
     33
     34
    1935def didTestFail( result, project, buildStep ) :
    2036  retVal = None
    2137
    2238  # If the return code is not 0, then failure
    23   if result['returnCode'] != 0 :
    24     retVal = "Non-zero return code of "+str(result['returnCode'])
     39  retVal=rc0(result,project)
     40  if retVal : return retVal
    2541
    2642  # Many tests write a "Success" message.
     
    2844  if NBprojectConfig.ALL_TESTS_COMPLETED_SUCCESSFULLY_CMDS.has_key(project) :
    2945    if buildStep in NBprojectConfig.ALL_TESTS_COMPLETED_SUCCESSFULLY_CMDS[project] :
    30       # Is the success message contained in the output?
    31       if result['stderr'].rfind("All tests completed successfully") == -1 and \
    32          result['stdout'].rfind("All tests completed successfully") == -1 :
    33         # Success message not found, assume test failed
    34         retVal = "The output does not contain the messages: 'All tests completed successfully'"
     46      retVal= standardSucessMessage(result,project)
     47      if retVal : return retVal
    3548
    3649  #---------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.