Changeset 739 for branches


Ignore:
Timestamp:
Nov 9, 2007 7:43:14 PM (12 years ago)
Author:
jpfasano
Message:

Initial effort for building on windows with MS solution file.

Location:
branches/testScripts
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/AUTHORS

    • Property svn:eol-style set to native
  • branches/testScripts/INSTALL

    • Property svn:eol-style set to native
    r714 r739  
    1515Please read the comments in NBuserParametersDefault.ny about detailed information which settings can be made and how they are specified.
    1616To get things running properly, you will need to specify at least information about the sending of emails.
     17
     18To build on Windows using the Microsoft compiler and the COIN-OR project supplied solution
     19files (.sln) the following hints may be useful:
     20- Subversion needs to be installed and runnable from a dos window command line.
     21  The following subversion install file has worked for this:
     22  http://subversion.tigris.org/files/documents/15/39559/svn-1.4.5-setup.exe
     23- Python needs to be installed and runnable from a dos window command line.
     24- The environment variables for accessing the microsoft compiler must be setup.
     25  Microsoft provides a script to do this:
     26  Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat
     27- The LIB environment variable needs to be set to the location of some MS provided
     28  libraries.  The following commands have been used to achieve this:
     29  set LIB=E:\Microsoft Platform SDK for Windows Server 2003 R2\Lib
     30  set LIB=E:\Microsoft Visual Studio 8\VC\lib;%LIB%
     31
     32- A summary of the commands that have worked to start nightlyBuild for a DOS window
     33  are:
     34    "E:\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
     35    set LIB=E:\Microsoft Platform SDK for Windows Server 2003 R2\Lib
     36    set LIB=E:\Microsoft Visual Studio 8\VC\lib;%LIB%
     37    f:
     38    cd \testScripts\
     39    nightlyBuild.py
     40
  • branches/testScripts/LICENSE

    • Property svn:eol-style set to native
  • branches/testScripts/NBbuildConfig.py

    r737 r739  
    3636#   Examples are: "trunk", "stable/3.2", "releases/3.3.3"
    3737#
     38#  configuration['buildMethod']= Defines method for building code.
     39#  Choices are:
     40#    msSoln: use microsoft compiler with a solution (sln) file.
     41#    unixConfig: use sequence "./configure", "make", "make test"
     42#
    3843#  configuration['noThirdParty']=True or False (optional). If False
    3944#   then 3rd party code will be used. If not specified then 3rd part
    4045#   code will be skipped.
     46#   Only used if configuration['buildMethod']=='unixConfig'
    4147#
    4248#  configuration['configOptions']: Parameters to be passed to configure.
    4349#   The -C option and the options for skipping 3rd party code do not
    4450#   need to be specified.  These will be generated by this function.
    45 #   There are two types of configOptions to be specified.
     51#   There are two types of configOptions to be specified.
     52#   Only used if configuration['buildMethod']=='unixConfig'
    4653#  configuration['configOptions']['unique']= These are options that
    4754#   distinguish different build configurations.  These options are used
     
    5259#   to be part of the vpath directory name.
    5360#   Example: 'CXX="g++ -m64" LDFLAGS=-lstdc++'
    54 #
     61# 
    5562#  configuration['SkipProjects']= List of COIN projects to skip (exclude)
    5663#    from the build.
    5764#    examples: "Ipopt", "Ipopt DyLP"
     65#    Only used if configuration['buildMethod']=='unixConfig'
    5866#
    5967#  configuration['checkMakeTest']= function to be called to determine
    6068#    if "make test" ran correctly
     69#    Only used if configuration['buildMethod']=='unixConfig'
    6170#
    6271#  configuration['unitTest']= undefined or dictionary D where
     
    6574#    D['checkUnitTest']= function to be called to determine if unitTest
    6675#       ran correctly.
     76#    Only used if configuration['buildMethod']=='unixConfig'
     77#
     78#  configuration['test']
     79#  configuration['slnFile']
    6780#------------------------------------------------------------------------
    6881def run(configuration) :
     
    7487  #---------------------------------------------------------------------
    7588  # Create names of directory where source is located and
    76   # and were object, libs and executables are located (vpath).
    77   # To compute vpath directory, the ./configure options need to be
     89  # and were object, libs and executables are located (build directory)
     90  # To compute build directory, the ./configure options need to be
    7891  # generated.
    7992  #---------------------------------------------------------------------
     
    8598                 configuration['svnVersion']
    8699
    87   vpathDir=''
    88 
    89   if 'SkipProjects' in configuration :
    90     vpathDir+="No"+configuration['SkipProjects']
    91   if 'noThirdParty' in configuration :
    92     if configuration['noThirdParty'] :
    93       vpathDir+='-NoThirdParty'
    94   vpathDir=svnVersionFlattened+\
    95           configuration['configOptions']['unique']+\
    96           vpathDir
    97   vpathDir=vpathDir.replace(' ','')
    98   vpathDir=vpathDir.replace('"','')
    99   vpathDir=vpathDir.replace("'",'')
    100   vpathDir=vpathDir.replace('--enable','')
    101   if vpathDir==svnVersionFlattened : vpathDir+='-default'
    102 
    103   fullVpathDir = os.path.join(projectBaseDir,vpathDir)
     100  buildDir=''
     101
     102  if configuration['buildMethod']=='unixConfig' :
     103    if 'SkipProjects' in configuration :
     104      buildDir+="No"+configuration['SkipProjects']
     105    if 'noThirdParty' in configuration :
     106      if configuration['noThirdParty'] :
     107        buildDir+='-NoThirdParty'
     108    buildDir=svnVersionFlattened+\
     109            configuration['configOptions']['unique']+\
     110            buildDir
     111    buildDir=buildDir.replace(' ','')
     112    buildDir=buildDir.replace('"','')
     113    buildDir=buildDir.replace("'",'')
     114    buildDir=buildDir.replace('--enable','')
     115    if buildDir==svnVersionFlattened : buildDir+='-default'
     116
     117  fullBuildDir = os.path.join(projectBaseDir,buildDir)
    104118
    105119  NBlogMessages.writeMessage('  SVN source URL: '+svnCheckOutUrl)
    106120  NBlogMessages.writeMessage('  Checkout directory: '+projectCheckOutDir)
    107   NBlogMessages.writeMessage('  Vpath directory: '+fullVpathDir)
     121  NBlogMessages.writeMessage('  Build directory: '+fullBuildDir)
    108122 
    109123
    110124  #---------------------------------------------------------------------
    111   # Create the vpath directory if it doesn't exist
     125  # Create the build directory if it doesn't exist
    112126  # and remove file that indicates prior run tested ok.
    113127  #---------------------------------------------------------------------
    114   if not os.path.isdir(fullVpathDir) :
    115     os.makedirs(fullVpathDir)
     128  if not os.path.isdir(fullBuildDir) :
     129    os.makedirs(fullBuildDir)
    116130
    117131  #---------------------------------------------------------------------
     
    120134  #---------------------------------------------------------------------
    121135
    122   os.chdir(fullVpathDir)
     136  os.chdir(fullBuildDir)
    123137  if os.path.isfile('NBallTestsPassed') :
    124138    msg=NBsvnCommand.newer(svnCheckOutUrl,projectCheckOutDir)
     
    129143    NBlogMessages.writeMessage('  '+msg)
    130144   
    131     # Must remove file NBallTestsPassed from all vpath directories that
     145    # Must remove file NBallTestsPassed from all build directories that
    132146    # use projectCheckoutDir for their source code. This is to ensure
    133     # that make will be run in all the vpath dirs after "svn update"
     147    # that make will be run in all the build dirs after "svn update"
    134148    dirs = os.listdir("..")
    135149    for d in dirs :
    136       if d.startswith(configuration['svnVersion']) and \
    137          d!=configuration['svnVersion']:
     150      if d.startswith(configuration['svnVersion']) :
    138151        fileToBeRemoved=os.path.join("..",d,'NBallTestsPassed')
    139152        if os.path.isfile(fileToBeRemoved) :
     
    203216          NBlogMessages.writeMessage('  Skipped a new download into '+thirdPartyBaseDir)
    204217
    205   #---------------------------------------------------------------------
    206   # Source is now available, so now it is time to run config
    207   #---------------------------------------------------------------------
    208   skipOptions=''
    209 
    210   if 'SkipProjects' in configuration :
    211     skipOptions+=configuration['SkipProjects']
    212 
    213   # If needed create option for skipping 3rd party code
    214   needSkip3PartySkipOptions=False
    215   if 'noThirdParty' not in configuration :
    216     needSkip3PartySkipOptions=True
    217   elif configuration['noThirdParty'] :
    218     needSkip3PartySkipOptions=True
    219   if needSkip3PartySkipOptions :
    220     thirdPartyBaseDir=os.path.join(projectCheckOutDir,'ThirdParty')
    221     if os.path.isdir(thirdPartyBaseDir) :
    222       thirdPartyDirs = os.listdir(thirdPartyBaseDir)
    223       for d in thirdPartyDirs :
    224         skipOptions+=' ThirdParty/'+d
    225 
    226   if skipOptions!='' :
    227     skipOptions=' COIN_SKIP_PROJECTS="'+skipOptions+'"'
    228 
    229   os.chdir(fullVpathDir)
    230   NBlogMessages.writeMessage('  Current directory: '+fullVpathDir)
    231 
    232   # Assemble all config options together and create config command
    233   configOptions ="-C "+configuration['configOptions']['unique']
    234   configOptions+=configuration['configOptions']['invariant']
    235   configOptions+=skipOptions
    236   configCmd = os.path.join(projectCheckOutDir,"configure "+configOptions)
    237 
    238 
    239 
    240   # If config was previously run, then no need to run again.
    241 #  if NBcheckResult.didConfigRunOK() :
    242 #    NBlogMessages.writeMessage("  configure previously ran. Not rerunning.")
    243 #  else :
    244   NBlogMessages.writeMessage("  "+configCmd)
    245 
    246   # Finally run config
    247   result=NBosCommand.run(configCmd)
    248   stdoutfile=open('NBconfig.stdout','w')
    249   stdoutfile.write(result['stdout'])
    250   stdoutfile.close()
    251   stderrfile=open('NBconfig.stderr','w')
    252   stderrfile.write(result['stderr'])
    253   stderrfile.close()
    254 
    255   # Check if configure worked
    256   if result['returnCode'] != 0 :
    257       error_msg = result
    258       error_msg['configure flags']=configOptions
    259       error_msg['svn version']=configuration['svnVersion']
    260       # Add contents of log file to message
    261       logFileName = 'config.log'
    262       if os.path.isfile(logFileName) :
    263         logFilePtr = open(logFileName,'r')
    264         error_msg['config.log'] = logFilePtr.read()
    265         logFilePtr.close()
    266       NBemail.sendCmdMsgs(configuration['project'],error_msg,configCmd)
    267       return
    268 
    269   #---------------------------------------------------------------------
    270   # Run make part of build
    271   #---------------------------------------------------------------------
    272   NBlogMessages.writeMessage( '  make' )
    273   result=NBosCommand.run('make')
    274   stdoutfile=open('NBmake.stdout','w')
    275   stdoutfile.write(result['stdout'])
    276   stdoutfile.close()
    277   stderrfile=open('NBmake.stderr','w')
    278   stderrfile.write(result['stderr'])
    279   stderrfile.close()
    280 
    281   # Check if make worked
    282   if result['returnCode'] != 0 :
    283     result['configure flags']=configOptions
    284     result['svn version']=configuration['svnVersion']
    285     NBemail.sendCmdMsgs(configuration['project'],result,'make')
    286     return
    287 
    288   #---------------------------------------------------------------------
    289   # Run 'make test' part of build
    290   #---------------------------------------------------------------------
    291   NBlogMessages.writeMessage( '  make test' )
    292   result=NBosCommand.run('make test')
    293   stdoutfile=open('NBmaketest.stdout','w')
    294   stdoutfile.write(result['stdout'])
    295   stdoutfile.close()
    296   stderrfile=open('NBmaketest.stderr','w')
    297   stderrfile.write(result['stderr'])
    298   stderrfile.close()
    299 
    300   # Check if 'make test' worked
    301   for testFunc in configuration['checkMakeTest'] :
    302     testResultFail=testFunc(result,configuration['project'])
    303     if testResultFail :
     218  if configuration['buildMethod']=='unixConfig' :
     219    #---------------------------------------------------------------------
     220    # Source is now available, so now it is time to run config
     221    #---------------------------------------------------------------------
     222    skipOptions=''
     223
     224    if 'SkipProjects' in configuration :
     225      skipOptions+=configuration['SkipProjects']
     226
     227    # If needed create option for skipping 3rd party code
     228    needSkip3PartySkipOptions=False
     229    if 'noThirdParty' not in configuration :
     230      needSkip3PartySkipOptions=True
     231    elif configuration['noThirdParty'] :
     232      needSkip3PartySkipOptions=True
     233    if needSkip3PartySkipOptions :
     234      thirdPartyBaseDir=os.path.join(projectCheckOutDir,'ThirdParty')
     235      if os.path.isdir(thirdPartyBaseDir) :
     236        thirdPartyDirs = os.listdir(thirdPartyBaseDir)
     237        for d in thirdPartyDirs :
     238          skipOptions+=' ThirdParty/'+d
     239
     240    if skipOptions!='' :
     241      skipOptions=' COIN_SKIP_PROJECTS="'+skipOptions+'"'
     242
     243    os.chdir(fullBuildDir)
     244    NBlogMessages.writeMessage('  Current directory: '+fullBuildDir)
     245
     246    # Assemble all config options together and create config command
     247    configOptions ="-C "+configuration['configOptions']['unique']
     248    configOptions+=configuration['configOptions']['invariant']
     249    configOptions+=skipOptions
     250    configCmd = os.path.join(projectCheckOutDir,"configure "+configOptions)
     251
     252
     253
     254    # If config was previously run, then no need to run again.
     255  #  if NBcheckResult.didConfigRunOK() :
     256  #    NBlogMessages.writeMessage("  configure previously ran. Not rerunning.")
     257  #  else :
     258    NBlogMessages.writeMessage("  "+configCmd)
     259
     260    # Finally run config
     261    result=NBosCommand.run(configCmd)
     262    stdoutfile=open('NBconfig.stdout','w')
     263    stdoutfile.write(result['stdout'])
     264    stdoutfile.close()
     265    stderrfile=open('NBconfig.stderr','w')
     266    stderrfile.write(result['stderr'])
     267    stderrfile.close()
     268
     269    # Check if configure worked
     270    if result['returnCode'] != 0 :
     271        error_msg = result
     272        error_msg['configure flags']=configOptions
     273        error_msg['svn version']=configuration['svnVersion']
     274        # Add contents of log file to message
     275        logFileName = 'config.log'
     276        if os.path.isfile(logFileName) :
     277          logFilePtr = open(logFileName,'r')
     278          error_msg['config.log'] = logFilePtr.read()
     279          logFilePtr.close()
     280        NBemail.sendCmdMsgs(configuration['project'],error_msg,configCmd)
     281        return
     282
     283    #---------------------------------------------------------------------
     284    # Run make part of build
     285    #---------------------------------------------------------------------
     286    NBlogMessages.writeMessage( '  make' )
     287    result=NBosCommand.run('make')
     288    stdoutfile=open('NBmake.stdout','w')
     289    stdoutfile.write(result['stdout'])
     290    stdoutfile.close()
     291    stderrfile=open('NBmake.stderr','w')
     292    stderrfile.write(result['stderr'])
     293    stderrfile.close()
     294
     295    # Check if make worked
     296    if result['returnCode'] != 0 :
    304297      result['configure flags']=configOptions
    305298      result['svn version']=configuration['svnVersion']
    306       result['make test']=testResultFail
    307       NBemail.sendCmdMsgs(configuration['project'],result,"make test")
     299      NBemail.sendCmdMsgs(configuration['project'],result,'make')
    308300      return
    309301
    310 
    311   #---------------------------------------------------------------------
    312   # Run unitTest if available and different from 'make test'
    313   #---------------------------------------------------------------------
    314   if "unitTest" in configuration :
    315     unitTestRelPath=configuration['unitTest']['path']
    316     unitTestPath = os.path.join(fullVpathDir,unitTestRelPath)
    317     os.chdir(unitTestPath)
    318     NBlogMessages.writeMessage('  Current directory: '+unitTestPath)
    319 
    320     unitTestCmdTemplate=configuration['unitTest']['command']
    321 
    322     dataBaseDir=os.path.join(configuration['rootDir'],'Data')
    323     netlibDir=os.path.join(dataBaseDir,'Netlib')
    324     miplib3Dir=os.path.join(dataBaseDir,'miplib3')
    325 
    326     unitTestCmd=unitTestCmdTemplate.replace('_NETLIBDIR_',netlibDir)
    327     unitTestCmd=unitTestCmd.replace('_MIPLIB3DIR_',miplib3Dir)
    328 
    329     NBlogMessages.writeMessage( '  '+unitTestCmd )
    330     result=NBosCommand.run(unitTestCmd)
    331     stdoutfile=open('NBunittest.stdout','w')
     302  #---------------------------------------------------------------------
     303  # Run 'make test' part of build
     304  #---------------------------------------------------------------------
     305  if configuration['buildMethod']=='unixConfig' :
     306    NBlogMessages.writeMessage( '  make test' )
     307    result=NBosCommand.run('make test')
     308    stdoutfile=open('NBmaketest.stdout','w')
    332309    stdoutfile.write(result['stdout'])
    333310    stdoutfile.close()
    334     stderrfile=open('NBunittest.stderr','w')
     311    stderrfile=open('NBmaketest.stderr','w')
    335312    stderrfile.write(result['stderr'])
    336313    stderrfile.close()
    337314
    338     #didUnitTestFail=configuration['unitTest']['checkUnitTest'](result,configuration['project'],unitTestCmdTemplate)
    339     #if didUnitTestFail :
    340     #  result['configure flags']=configOptions
    341     #  result['svn version']=configuration['svnVersion']
    342     #  result['unitTest']=didUnitTestFail
    343     #  NBemail.sendCmdMsgs(p,result,unitTestCmd)
    344     #  return
    345    
    346     for testFunc in configuration['unitTest']['checkUnitTest'] :
     315    # Check if 'make test' worked
     316    for testFunc in configuration['checkMakeTest'] :
    347317      testResultFail=testFunc(result,configuration['project'])
    348318      if testResultFail :
    349319        result['configure flags']=configOptions
    350320        result['svn version']=configuration['svnVersion']
    351         result['unitTest']=testResultFail
    352         NBemail.sendCmdMsgs(configuration['project'],result,unitTestCmd)
     321        result['make test']=testResultFail
     322        NBemail.sendCmdMsgs(configuration['project'],result,"make test")
    353323        return
    354324
     325  if configuration['buildMethod']=='msSln' :
     326    #---------------------------------------------------------------------
     327    # Source is now available, so now it is time to run vcbuild
     328    #---------------------------------------------------------------------
     329   
     330    os.chdir(projectCheckOutDir)
     331    NBlogMessages.writeMessage('  Current directory: '+projectCheckOutDir)
     332
     333    if configuration.has_key('slnFile') :
     334      slnFileName = os.path.join(projectCheckOutDir,configuration['slnFile'])
     335    else :
     336      slnFileName = os.path.join(projectCheckOutDir,\
     337                          configuration['project'],\
     338                          'MSVisualStudio',\
     339                          'v8',\
     340                          configuration['project']) +\
     341                    '.sln'
     342    if not os.path.isfile(slnFileName) :
     343      NBlogMessages.writeMessage("  Solution file does not exist: "+slnFileName)
     344      return
     345
     346    vcbuild='vcbuild /u ' + slnFileName + ' $ALL'
     347             
     348
     349    NBlogMessages.writeMessage("  "+vcbuild)
     350
     351    # Finally run vcbuild
     352    result=NBosCommand.run(vcbuild)
     353    stdoutfile=open('NBvcbuild.stdout','w')
     354    stdoutfile.write(result['stdout'])
     355    stdoutfile.close()
     356    stderrfile=open('NBvcbuild.stderr','w')
     357    stderrfile.write(result['stderr'])
     358    stderrfile.close()
     359
     360    # Check if vcbuild worked
     361    if result['returnCode'] != 0 :
     362        error_msg = result
     363        error_msg['svn version']=configuration['svnVersion']
     364        NBemail.sendCmdMsgs(configuration['project'],error_msg,vcbuild)
     365        return
     366
     367  #---------------------------------------------------------------------
     368  # Run unitTest if available and different from 'make test'
     369  #---------------------------------------------------------------------
     370  if configuration['buildMethod']=='unixConfig' :
     371    if "unitTest" in configuration :
     372      unitTestRelPath=configuration['unitTest']['path']
     373      unitTestPath = os.path.join(fullBuildDir,unitTestRelPath)
     374      os.chdir(unitTestPath)
     375      NBlogMessages.writeMessage('  Current directory: '+unitTestPath)
     376
     377      unitTestCmdTemplate=configuration['unitTest']['command']
     378
     379      dataBaseDir=os.path.join(configuration['rootDir'],'Data')
     380      netlibDir=os.path.join(dataBaseDir,'Netlib')
     381      miplib3Dir=os.path.join(dataBaseDir,'miplib3')
     382
     383      unitTestCmd=unitTestCmdTemplate.replace('_NETLIBDIR_',netlibDir)
     384      unitTestCmd=unitTestCmd.replace('_MIPLIB3DIR_',miplib3Dir)
     385
     386      NBlogMessages.writeMessage( '  '+unitTestCmd )
     387      result=NBosCommand.run(unitTestCmd)
     388      stdoutfile=open('NBunittest.stdout','w')
     389      stdoutfile.write(result['stdout'])
     390      stdoutfile.close()
     391      stderrfile=open('NBunittest.stderr','w')
     392      stderrfile.write(result['stderr'])
     393      stderrfile.close()
     394   
     395      for testFunc in configuration['unitTest']['checkUnitTest'] :
     396        testResultFail=testFunc(result,configuration['project'])
     397        if testResultFail :
     398          result['configure flags']=configOptions
     399          result['svn version']=configuration['svnVersion']
     400          result['unitTest']=testResultFail
     401          NBemail.sendCmdMsgs(configuration['project'],result,unitTestCmd)
     402          return
     403
     404  if configuration['buildMethod']=='msSln' :   
     405    #---------------------------------------------------------------------
     406    # Run all test executables
     407    #---------------------------------------------------------------------
     408    if "test" in configuration :
     409      for t in range( len(configuration['test']) ) :
     410        testRelDir=configuration['test'][t]['dir']
     411        testDir = os.path.join(projectCheckOutDir,testRelDir)
     412        os.chdir(testDir)
     413        NBlogMessages.writeMessage('  Current directory: '+testDir)
     414
     415        testCmd=configuration['test'][t]['cmd']
     416
     417        NBlogMessages.writeMessage( '  '+testCmd )
     418        result=NBosCommand.run(testCmd)
     419        stdoutfile=open('NBtest.stdout','w')
     420        stdoutfile.write(result['stdout'])
     421        stdoutfile.close()
     422        stderrfile=open('NBtest.stderr','w')
     423        stderrfile.write(result['stderr'])
     424        stderrfile.close()
     425       
     426        for testFunc in configuration['test'][t]['check'] :
     427          testResultFail=testFunc(result,configuration['project'])
     428          if testResultFail :
     429            result['svn version']=configuration['svnVersion']
     430            result['unitTest']=testResultFail
     431            NBemail.sendCmdMsgs(configuration['project'],result,testCmd)
     432            return
     433
    355434
    356435  #---------------------------------------------------------------------
    357436  # Everything build and all tests passed.
    358437  #---------------------------------------------------------------------
    359   os.chdir(fullVpathDir)
     438  os.chdir(fullBuildDir)
    360439  f=open('NBallTestsPassed','w')
    361440  f.close()
  • branches/testScripts/NBprojectConfig.py

    r730 r739  
    2121CHECK_MAKE_TEST = {}
    2222CHECK_UNITTEST = {}
     23SLN_BLD_TEST = {}
     24CFG_BLD_TEST = {}
     25SLN_FILE = {}
    2326
    2427
     
    2831CHECK_MAKE_TEST['CoinUtils']=[NBcheckResult.rc0,
    2932                              NBcheckResult.standardSuccessMessage]
     33CFG_BLD_TEST['CoinUtils']=[
     34                  {'dir':'',
     35                   'cmd':'make test',
     36                   'check':[ NBcheckResult.rc0,
     37                             NBcheckResult.standardSuccessMessage ] } ]
    3038#does not have references to third party packages
    3139
     
    4250                         NBcheckResult.standardSuccessMessage,
    4351                         NBcheckResult.noSolverInterfaceTestingIssueMessage]
     52
     53CFG_BLD_TEST['DyLP']=[
     54                  {'dir':'',
     55                   'cmd':'make test',
     56                   'check':[ NBcheckResult.rc0,
     57                             NBcheckResult.standardSuccessMessage,
     58                             NBcheckResult.noSolverInterfaceTestingIssueMessage ] },
     59                  {'dir':'Osi/test',
     60                   'cmd':'./unitTest -testOsiSolverInterface -netlibDir=_NETLIBDIR_ -cerr2cout',
     61                   'check':[ NBcheckResult.rc0,
     62                             NBcheckResult.standardSuccessMessage,
     63                             NBcheckResult.endWithWoodw,
     64                             NBcheckResult.noSolverInterfaceTestingIssueMessage] } ]
     65
    4466#does not have references to third party packages
    4567
     
    4769PROJECT_EMAIL_ADDRS['Clp'] = 'jjforre _AT_ us _DOT_ ibm _DOT_ com'
    4870UNITTEST_DIR['Clp'] = os.path.join('Clp','src')
    49 UNITTEST_CMD['Clp'] = './clp -unitTest dirNetlib=_NETLIBDIR_ -netlib'
     71UNITTEST_CMD['Clp'] = './clp -unitTest -dirNetlib=_NETLIBDIR_ -netlib'
    5072CHECK_MAKE_TEST['Clp']=[
    5173                         NBcheckResult.rc0,
     
    5577                         NBcheckResult.standardSuccessMessage,
    5678                         NBcheckResult.endWithWoodw]
     79
     80CFG_BLD_TEST['Clp']=[
     81                  {'dir':'',
     82                   'cmd':'make test',
     83                   'check':[ NBcheckResult.rc0,
     84                             NBcheckResult.standardSuccessMessage ] },
     85                  {'dir':'Clp/Src',
     86                   'cmd':'./clp -unitTest -dirNetlib=_NETLIBDIR_ -netlib',
     87                   'check':[ NBcheckResult.rc0,
     88                             NBcheckResult.standardSuccessMessage,
     89                             NBcheckResult.endWithWoodw] } ]
     90SLN_BLD_TEST['Clp']=[
     91                  {'dir':r'Clp\MSVisualStudio\v8\clp\Release',
     92                   'cmd':'clp -dirSample=_SAMPLEDIR_ -unitTest -dirNetlib=_NETLIBDIR_ -netlib',
     93                   'check':[ NBcheckResult.rc0,
     94                             NBcheckResult.standardSuccessMessage,
     95                             NBcheckResult.endWithWoodw] },
     96                  {'dir':r'Clp\MSVisualStudio\v8\clp\Debug',
     97                   'cmd':'clp -dirSample=_SAMPLEDIR_ -unitTest -dirNetlib=_NETLIBDIR_ -netlib',
     98                   'check':[ NBcheckResult.rc0,
     99                             NBcheckResult.standardSuccessMessage,
     100                             NBcheckResult.endWithWoodw] } ]
    57101
    58102#----------------------------------------------------------------------
     
    67111                         NBcheckResult.standardSuccessMessage,
    68112                         ]
     113CFG_BLD_TEST['SYMPHONY']=[
     114                  {'dir':'',
     115                   'cmd':'make test',
     116                   'check':[ NBcheckResult.rc0,
     117                             NBcheckResult.standardSuccessMessage ] },
     118                  {'dir':'',
     119                   'cmd':'make fulltest',
     120                   'check':[ NBcheckResult.rc0,
     121                             NBcheckResult.standardSuccessMessage ] } ]
     122SLN_BLD_TEST['SYMPHONY']=[ {
     123                   'dir':r'SYMPHONY\MSVisualStudio\v8\Release',
     124                   'cmd':r'symphony -F _NETLIBDIR_\25fv47.mps',
     125                   'check':[ NBcheckResult.rc0 ] },
     126                  {'dir':r'SYMPHONY\MSVisualStudio\v8\Debug',
     127                   'cmd':r'symphony -F _NETLIBDIR_\25fv47.mps',
     128                   'check':[ NBcheckResult.rc0 ] } ]
    69129
    70130#----------------------------------------------------------------------
     
    72132CHECK_MAKE_TEST['Vol']=[
    73133                         NBcheckResult.rc0]
     134CFG_BLD_TEST['Vol']=[
     135                  {'dir':'',
     136                   'cmd':'make test',
     137                   'check':[ NBcheckResult.rc0 ] } ]
    74138#does not have references to third party packages
    75139
     
    86150                         NBcheckResult.standardSuccessMessage,
    87151                         NBcheckResult.noSolverInterfaceTestingIssueMessage]
     152CFG_BLD_TEST['Osi']=[
     153                  {'dir':'',
     154                   'cmd':'make test',
     155                   'check':[ NBcheckResult.rc0,
     156                             NBcheckResult.standardSuccessMessage,
     157                             NBcheckResult.noSolverInterfaceTestingIssueMessage ] },
     158                  {'dir':'Osi/test',
     159                   'cmd':'./unitTest -testOsiSolverInterface -netlibDir=_NETLIBDIR_ -cerr2cout',
     160                   'check':[ NBcheckResult.rc0,
     161                             NBcheckResult.standardSuccessMessage,
     162                             NBcheckResult.noSolverInterfaceTestingIssueMessage] } ]
     163
     164SLN_BLD_TEST['Osi']=[
     165                  {'dir':r'Osi\MSVisualStudio\v8\OsiExamplesBuild\Release',
     166                   'cmd':'OsiExamplesBuild',
     167                   'check':[ NBcheckResult.rc0 ] },
     168                  {'dir':r'Osi\MSVisualStudio\v8\OsiExamplesBuild\Debug',
     169                   'cmd':'OsiExamplesBuild',
     170                   'check':[ NBcheckResult.rc0 ] } ]
    88171
    89172#----------------------------------------------------------------------
     
    92175                         NBcheckResult.rc0,
    93176                         NBcheckResult.standardSuccessMessage]
     177CFG_BLD_TEST['Cgl']=[
     178                  {'dir':'',
     179                   'cmd':'make test',
     180                   'check':[ NBcheckResult.rc0,
     181                             NBcheckResult.standardSuccessMessage ] } ]
    94182#does not have references to third party packages
    95183
     
    103191CHECK_UNITTEST['Cbc']=[ NBcheckResult.rc0to2 ]
    104192
     193CFG_BLD_TEST['Cbc']=[
     194                  {'dir':'',
     195                   'cmd':'make test',
     196                   'check':[ NBcheckResult.rc0,
     197                             NBcheckResult.cbcMakeTestSuccessMessage ] },
     198                  {'dir':'Cbc/Src',
     199                   'cmd':'./cbc -unitTest -dirMiplib=_MIPLIB3DIR_ -miplib',
     200                   'check':[ NBcheckResult.rc0to2 ] } ]
     201
     202SLN_BLD_TEST['Cbc']=[
     203                  {'dir':r'Cbc\MSVisualStudio\v8\cbcSolve\Release',
     204                   'cmd':'cbcSolve -dirSample=_SAMPLEDIR_ -unitTest -dirMiplib=_MIPLIB3DIR_ -miplib',
     205                   'check':[ NBcheckResult.rc0to2 ] },
     206                  {'dir':r'Cbc\MSVisualStudio\v8\cbcSolve\Debug',
     207                   'cmd':'cbcSolve -dirSample=_SAMPLEDIR_ -unitTest -dirMiplib=_MIPLIB3DIR_ -miplib',
     208                   'check':[ NBcheckResult.rc0to2 ] } ]
     209
    105210#----------------------------------------------------------------------
    106211PROJECT_EMAIL_ADDRS['Ipopt'] = 'andreasw _AT_ us _DOT_ ibm _DOT_ com'
     
    108213                         # ,NBcheckResult.standardSuccessMessage
    109214                         ]
     215CFG_BLD_TEST['Ipopt']=[
     216                  {'dir':'',
     217                   'cmd':'make test',
     218                   'check':[ NBcheckResult.rc0
     219                             #,NBcheckResult.standardSuccessMessage
     220                  ] } ]
    110221#third party packages are not optional here
    111222
     
    115226                          ,NBcheckResult.standardSuccessMessage
    116227                          ]
     228CFG_BLD_TEST['Bonmin']=[
     229                  {'dir':'',
     230                   'cmd':'make test',
     231                   'check':[ NBcheckResult.rc0,
     232                             NBcheckResult.standardSuccessMessage ] } ]
    117233#third party packages are not optional here
    118234
     
    122238                         NBcheckResult.rc0,
    123239                         NBcheckResult.standardSuccessMessage]
     240CFG_BLD_TEST['FlopC++']=[
     241                  {'dir':'',
     242                   'cmd':'make test',
     243                   'check':[ NBcheckResult.rc0,
     244                             NBcheckResult.cbcMakeTestSuccessMessage ] } ]
     245SLN_FILE['FlopC++']=r'FlopCpp\MSVisualStudio\v8\FlopCpp.sln'
     246SLN_BLD_TEST['FlopC++']=[
     247                  {'dir':r'FlopCpp\MSVisualStudio\v8\Release',
     248                   'cmd':'unitTest -dirSample=_SAMPLEDIR_ -unitTest -dirNetlib=_NETLIBDIR_ -netlib',
     249                   'check':[ NBcheckResult.rc0,
     250                             NBcheckResult.standardSuccessMessage ] },
     251                  {'dir':r'FlopCpp\MSVisualStudio\v8\Debug',
     252                   'cmd':'unitTest -dirSample=_SAMPLEDIR_ -unitTest -dirNetlib=_NETLIBDIR_ -netlib',
     253                   'check':[ NBcheckResult.rc0,
     254                             NBcheckResult.standardSuccessMessage ] } ]
     255
    124256#does not have references to third party packages
    125257
     
    129261                         NBcheckResult.rc0,
    130262                         NBcheckResult.standardSuccessMessage]
     263CFG_BLD_TEST['OS']=[
     264                  {'dir':'',
     265                   'cmd':'make test',
     266                   'check':[ NBcheckResult.rc0,
     267                             NBcheckResult.cbcMakeTestSuccessMessage ] } ]
    131268#third party packages are not optional if Ipopt is not excluded
    132269
     
    136273UNITTEST_DIR['CppAD'] = os.path.join('.')
    137274UNITTEST_CMD['CppAD'] = './example/example'
    138 CHECK_UNITTEST['CppAD']=[NBcheckResult.rc0]
     275CHECK_UNITTEST['CppAD']=[NBcheckResult.rc0]
     276
     277CFG_BLD_TEST['CppAD']=[
     278                  {'dir':'',
     279                   'cmd':'./example/example',
     280                   'check':[ NBcheckResult.rc0 ] } ]
    139281#does not have references to third party packages
    140282
     
    144286                         NBcheckResult.rc0,
    145287                         NBcheckResult.standardSuccessMessage]
     288CFG_BLD_TEST['Smi']=[
     289                  {'dir':'',
     290                   'cmd':'make test',
     291                   'check':[ NBcheckResult.rc0 ] } ]
     292SLN_BLD_TEST['Smi']=[
     293                  {'dir':r'Smi\MSVisualStudio\v8\unitTest\Release',
     294                   'cmd':'unitTest -dirSample=_SAMPLEDIR_ -unitTest -dirNetlib=_NETLIBDIR_ -netlib',
     295                   'check':[ NBcheckResult.rc0,
     296                             NBcheckResult.standardSuccessMessage ] },
     297                  {'dir':r'Smi\MSVisualStudio\v8\unitTest\Debug',
     298                   'cmd':'unitTest -dirSample=_SAMPLEDIR_ -unitTest -dirNetlib=_NETLIBDIR_ -netlib',
     299                   'check':[ NBcheckResult.rc0,
     300                             NBcheckResult.standardSuccessMessage ] } ]
    146301#does not have references to third party packages
    147302#TODO: need some check whether make test was successful; what is the behaviour in Smi's unittest if it fails?
  • branches/testScripts/README

    • Property svn:eol-style set to native
    r714 r739  
    2727The output of get.XXX scripts, configure, make, unittests to stdout and stderr is also stored in the build directories for later analysis (e.g., NBmake.stdout).
    2828
    29 To install and use NightlyBuile please see the INSTALL file.
     29To install and use NightlyBuild please see the INSTALL file.
  • branches/testScripts/nightlyBuild.py

    r734 r739  
    4949if not os.path.isdir(dataBaseDir) :
    5050  os.makedirs(dataBaseDir)
    51 dataDirs=['Netlib','miplib3']
     51dataDirs=['Netlib','miplib3','Sample']
    5252for d in dataDirs :
    5353  dataDir=os.path.join(dataBaseDir,d)
    5454  if not os.path.isdir(dataDir) :
    55     svnCmd='svn checkout https://projects.coin-or.org/svn/Data/releases/1.0.0/'+d+' '+d
     55    svnCmd='svn checkout https://projects.coin-or.org/svn/Data/releases/1.0.4/'+d+' '+d
    5656    if NBsvnCommand.run(svnCmd,dataBaseDir,'Data')!='OK' :
    5757      sys.exit(1)
     
    5959netlibDir=os.path.join(dataBaseDir,'Netlib')
    6060miplib3Dir=os.path.join(dataBaseDir,'miplib3')
    61 
    62 #------------------------------------------------------------------------
    63 # Loop once for each project (get code, compile & link, and test).
     61sampleDir=os.path.join(dataBaseDir,'Sample')
     62
     63#------------------------------------------------------------------------
     64# Define loop invariant configuration values
    6465#------------------------------------------------------------------------
    6566configuration={}
    6667configuration['rootDir']=NIGHTLY_BUILD_ROOT_DIR
    67 #for p,buildConfigs in NBprojectConfig.BUILDS.iteritems():
     68configurations = set("")
     69
     70#------------------------------------------------------------------------
     71# Define how code is is to be built. Choices are:
     72# msSoln: use microsoft compiler with a solution (sln) file.
     73# unixConfig: use sequence "./configure", "make", "make test"
     74#------------------------------------------------------------------------
     75if sys.platform=='win32' :
     76  configuration['buildMethod']='msSln'
     77else :
     78  configuration['buildMethod']='unixConfig'
     79
     80#------------------------------------------------------------------------
     81# Loop once for each project (get code, compile & link, and test).
     82#------------------------------------------------------------------------
    6883for p in PROJECTS :
    6984
     
    116131
    117132    #--------------------------------------------------------------------
    118     # Setup usage of 3rd Party code
    119     #--------------------------------------------------------------------
    120     if 'noThirdParty' in configuration: configuration.pop('noThirdParty')
    121     if 'ThirdParty' in bc:
    122       if bc['ThirdParty'].lower()=='yes' :
    123         configuration['noThirdParty']=False
    124       else:
    125         configuration['noThirdParty']=True
    126 
    127     #--------------------------------------------------------------------
    128     # Set config options
    129     #--------------------------------------------------------------------
    130     configuration['configOptions']={}
    131     configuration['configOptions']['unique']=""
    132     configuration['configOptions']['invariant']=""
    133     if 'OptLevel' not in bc :
    134       print 'Error. BUILDS does not contain OptLevel'
    135       print '       Project is '+p
    136       print '       BuildConfig is '+str(bc)
    137       sys.exit(1)
    138     if bc['OptLevel']=='Debug' :
    139       configuration['configOptions']['unique']+=" --enable-debug"
    140     if 'AdditionalConfigOptions' in bc :
    141       configuration['configOptions']['unique']+=" "+bc['AdditionalConfigOptions']
    142 
    143     configuration['configOptions']['invariant']+=" "+ CONFIGURE_FLAGS
    144 
    145     #--------------------------------------------------------------------
    146     # Deal with coin projects to be skipped by ./config
    147     #--------------------------------------------------------------------
    148     if 'SkipProjects' in configuration: configuration.pop('SkipProjects')
    149     if 'SkipProjects' in bc :
    150       configuration['SkipProjects']=bc['SkipProjects']
    151 
    152     #---------------------------------------------------------------------
    153     # Setup checkMakeTest
    154     #---------------------------------------------------------------------
    155     #configuration['checkMakeTest']=NBcheckResult.didTestFail
    156     configuration['checkMakeTest']=NBprojectConfig.CHECK_MAKE_TEST[p]
    157 
    158 
    159     #---------------------------------------------------------------------
    160     # Set up unitTest
    161     #---------------------------------------------------------------------
    162     configuration['unitTest']={}
    163     if NBprojectConfig.UNITTEST_CMD.has_key(p) :
    164 
    165       unitTestCmdTemplate=NBprojectConfig.UNITTEST_CMD[p]
    166       unitTestCmd=unitTestCmdTemplate.replace('_NETLIBDIR_',netlibDir)
    167       unitTestCmd=unitTestCmd.replace('_MIPLIB3DIR_',miplib3Dir)
    168 
    169       configuration['unitTest']['command']=unitTestCmd
    170       configuration['unitTest']['checkUnitTest']=NBprojectConfig.CHECK_UNITTEST[p]
    171       configuration['unitTest']['path']=NBprojectConfig.UNITTEST_DIR[p]
    172 
    173     else :
    174       # No unitTest so remove from configuration
    175       configuration.pop('unitTest')
     133    # Process Parameters that are used by unix configure style build
     134    #--------------------------------------------------------------------
     135    if configuration['buildMethod']=='unixConfig' :
     136      #--------------------------------------------------------------------
     137      # Doing a unix config type build.  Grab unix config parms
     138      #--------------------------------------------------------------------
     139
     140      #--------------------------------------------------------------------
     141      # Setup usage of 3rd Party code
     142      #--------------------------------------------------------------------
     143      if 'noThirdParty' in configuration: configuration.pop('noThirdParty')
     144      if 'ThirdParty' in bc:
     145        if bc['ThirdParty'].lower()=='yes' :
     146          configuration['noThirdParty']=False
     147        else:
     148          configuration['noThirdParty']=True
     149
     150      #--------------------------------------------------------------------
     151      # Set config options
     152      #--------------------------------------------------------------------
     153      configuration['configOptions']={}
     154      configuration['configOptions']['unique']=""
     155      configuration['configOptions']['invariant']=""
     156      if 'OptLevel' not in bc :
     157        print 'Error. BUILDS does not contain OptLevel'
     158        print '       Project is '+p
     159        print '       BuildConfig is '+str(bc)
     160        sys.exit(1)
     161      if bc['OptLevel']=='Debug' :
     162        configuration['configOptions']['unique']+=" --enable-debug"
     163      if 'AdditionalConfigOptions' in bc :
     164        configuration['configOptions']['unique']+=" "+bc['AdditionalConfigOptions']
     165
     166      configuration['configOptions']['invariant']+=" "+ CONFIGURE_FLAGS
     167
     168      #--------------------------------------------------------------------
     169      # Deal with coin projects to be skipped by ./config
     170      #--------------------------------------------------------------------
     171      if 'SkipProjects' in configuration: configuration.pop('SkipProjects')
     172      if 'SkipProjects' in bc :
     173        configuration['SkipProjects']=bc['SkipProjects']
     174
     175      #---------------------------------------------------------------------
     176      # Setup checkMakeTest
     177      #---------------------------------------------------------------------
     178      configuration['checkMakeTest']=NBprojectConfig.CHECK_MAKE_TEST[p]
     179
     180
     181      #---------------------------------------------------------------------
     182      # Set up unitTest
     183      #---------------------------------------------------------------------
     184      configuration['unitTest']={}
     185      if NBprojectConfig.UNITTEST_CMD.has_key(p) :
     186
     187        unitTestCmdTemplate=NBprojectConfig.UNITTEST_CMD[p]
     188        unitTestCmd=unitTestCmdTemplate.replace('_NETLIBDIR_',netlibDir)
     189        unitTestCmd=unitTestCmd.replace('_MIPLIB3DIR_',miplib3Dir)
     190        unitTestCmd=unitTestCmd.replace('_SAMPLEDIR_',sampleDir)
     191
     192        configuration['unitTest']['command']=unitTestCmd
     193        configuration['unitTest']['checkUnitTest']=NBprojectConfig.CHECK_UNITTEST[p]
     194        configuration['unitTest']['path']=NBprojectConfig.UNITTEST_DIR[p]
     195
     196      else :
     197        # No unitTest so remove from configuration
     198        configuration.pop('unitTest')
     199
     200    if configuration['buildMethod']=='msSln' :
     201      #--------------------------------------------------------------------
     202      # Doing a microsoft solution  build.  Grap ms sln parms
     203      #--------------------------------------------------------------------
     204
     205      #---------------------------------------------------------------------
     206      # Set up test executables
     207      #---------------------------------------------------------------------
     208      configuration['test']={}
     209      if NBprojectConfig.SLN_BLD_TEST.has_key(p) :
     210
     211        configuration['test']=NBprojectConfig.SLN_BLD_TEST[p]
     212        for t in range( len(configuration['test']) ) :
     213          testCmd=configuration['test'][t]['cmd']
     214          testCmd=testCmd.replace('_NETLIBDIR_',netlibDir)
     215          testCmd=testCmd.replace('_MIPLIB3DIR_',miplib3Dir)
     216          testCmd=testCmd.replace('_SAMPLEDIR_',sampleDir)
     217          configuration['test'][t]['cmd']=testCmd
     218         
     219      else :
     220        # No test executables so remove from configuration
     221        configuration.pop('test')
     222
     223      #---------------------------------------------------------------------
     224      # If solution file is not in standard place then specify it's location
     225      #---------------------------------------------------------------------
     226      configuration['slnFile']=''
     227      if NBprojectConfig.SLN_FILE.has_key(p) :
     228        configuration['slnFile']=NBprojectConfig.SLN_FILE[p]         
     229      else :
     230        configuration.pop('slnFile')
    176231
    177232    #--------------------------------------------------
    178     # Build & Test the configuration
     233    # Build & Test the configuration, if not previously done
    179234    #--------------------------------------------------
    180     NBbuildConfig.run(configuration)
     235    if str(configuration) not in configurations :
     236      NBbuildConfig.run(configuration)
     237      configurations=configurations | set([str(configuration)])
     238   
    181239
    182240
Note: See TracChangeset for help on using the changeset viewer.