Changeset 720 for branches


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

Location:
branches/testScripts
Files:
2 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  #---------------------------------------------------------------------
  • branches/testScripts/NBprojectConfig.py

    r718 r720  
    77
    88import os
     9import NBcheckResult
    910
    1011#----------------------------------------------------------------------
     
    1819UNITTEST_CMD = {}
    1920ALL_TESTS_COMPLETED_SUCCESSFULLY_CMDS = {}
     21CHECK_MAKE_TEST = {}
     22CHECK_UNITTEST = {}
    2023
    2124
     
    2427PROJECT_EMAIL_ADDRS['CoinUtils'] = 'ladanyi _AT_ us _DOT_ ibm _DOT_ com'
    2528ALL_TESTS_COMPLETED_SUCCESSFULLY_CMDS['CoinUtils'] = ['make test']
     29CHECK_MAKE_TEST['CoinUtils']=[NBcheckRsult.rc0,NBcheckResult.standardSuccessMessage]
    2630#does not have references to third party packages
    2731
Note: See TracChangeset for help on using the changeset viewer.