Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17192


Ignore:
Timestamp:
08/07/19 08:47:13 (5 years ago)
Author:
abeham
Message:

#3017: merged 17016, 17052, 17191 to stable (changes to Build and Test scripts)

Location:
stable
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/Build.ps1

    r16754 r17192  
    11# find ms build
    22$programFilesX86Dir = ($Env:ProgramFiles, ${Env:ProgramFiles(x86)})[[bool]${Env:ProgramFiles(x86)}]
    3 $locations = @(
    4   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise", "MSBuild", "15.0", "Bin", "amd64")
    5   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise", "MSBuild", "15.0", "Bin")
    6   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin", "amd64")
    7   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin")
    8   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools", "MSBuild", "15.0", "Bin", "amd64"),
    9   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools", "MSBuild", "15.0", "Bin")
    10 )
     3$vsDir = [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio")
     4$years = @("2019", "2017")
     5$editions = @("Enterprise", "Professional", "Community", "BuildTools")
     6$versions = @("Current", "15.0")
    117
    128$msBuildPath = $undefined
    13 Foreach ($loc in $locations) {
    14   $loc = [System.IO.Path]::Combine($loc, "MSBuild.exe")
    15   If ([System.IO.File]::Exists($loc)) {
    16     $msBuildPath = $loc
    17     Break;
     9:search Foreach ($year in $years) {
     10  $loc = [System.IO.Path]::Combine($vsDir, $year)
     11  Foreach ($edition in $editions) {
     12    $edLoc = [System.IO.Path]::Combine($loc, $edition, "MSBuild")
     13    Foreach ($version in $versions) {
     14      $binLoc = [System.IO.Path]::Combine($edLoc, $version, "Bin")
     15      $loc64 = [System.IO.Path]::Combine($binLoc, "amd64", "MSBuild.exe")
     16      $loc32 = [System.IO.Path]::Combine($binLoc, "MSBuild.exe")
     17
     18      If ([System.IO.File]::Exists($loc64)) {
     19        $msBuildPath = $loc64
     20        Break search;
     21      }
     22      If ([System.IO.File]::Exists($loc32)) {
     23        $msBuildPath = $loc32
     24        Break search;
     25      }
     26    }
    1827  }
    1928}
     
    2433    Return
    2534  }
     35
     36  "MSBuild located at `"{0}`"." -f $msBuildPath
    2637
    2738  $curPath = $MyInvocation.MyCommand.Path
  • stable/Test.cmd

    r13305 r17192  
    11@ECHO OFF
    2 
    3 SET /P BUILDBEFORETEST=Should the test project be rebuilt [n]:
    4 
    5 SET TESTCATEGORY=%~1
    6 
    7 IF "%TESTCATEGORY%"=="" SET TESTCATEGORY=Essential
    8 SET /P USERCATEGORY=Which category do you want to run  [%TESTCATEGORY%]:
    9 IF "%USERCATEGORY%" NEQ "" SET TESTCATEGORY=%USERCATEGORY%
    10 
    11 set /P TESTPLATFORM=Which platform to run the tests [x64]:
    12 IF "%TESTPLATFORM%"=="" SET TESTPLATFORM=x64
    13 
    14 FOR /F "tokens=1,3 delims=   " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"') DO (
    15   IF "%%A"=="MSBuildToolsPath" SET MSBUILDPATH=%%B)
    16    
    17 IF "%BUILDBEFORETEST%" NEQ "" (
    18   ECHO Building tests project ...
    19   %MSBUILDPATH%msbuild.exe "HeuristicLab 3.3 Tests.sln" /target:Rebuild /p:Configuration="Debug",Platform="%TESTPLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
    20 )
    21 
    22 ECHO Test starting for category %TESTCATEGORY%...
    23 
    24 FOR /F "tokens=1,2,* delims=   " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7"') DO (
    25   IF "%%A"=="14.0" SET VSPATH=%%C)
    26 
    27 "%VSPATH%Common7\IDE\CommonExtensions\Microsoft\TestWindow\VSTest.Console.exe" bin\HeuristicLab.Tests.dll /Framework:framework40 /Platform:%TESTPLATFORM% /TestCaseFilter:"TestCategory=%TESTCATEGORY%"
    28 
    29 PAUSE
     2powershell.exe .\Test.ps1
  • stable/Test.ps1

    r17016 r17192  
    11# find ms build
    22$programFilesX86Dir = ($Env:ProgramFiles, ${Env:ProgramFiles(x86)})[[bool]${Env:ProgramFiles(x86)}]
    3 $locations = @(
    4   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise")
    5   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community")
    6   [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools")
    7 )
     3$vsDir = [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio")
     4$years = @("2019", "2017")
     5$editions = @("Enterprise", "Professional", "Community", "BuildTools")
     6$versions = @("Current", "15.0")
    87
     8$msBuildPath = $undefined
    99$vstestPath = $undefined
    10 Foreach ($loc in $locations) {
    11   $vstestloc = [System.IO.Path]::Combine($loc, "Common7", "IDE", "CommonExtensions", "Microsoft", "TestWindow", "vstest.console.exe")
    12   If([System.IO.File]::Exists($vstestloc)) {
    13     $vstestPath = $vstestloc
    14     Break;
     10:search Foreach ($year in $years) {
     11  $loc = [System.IO.Path]::Combine($vsDir, $year)
     12  Foreach ($edition in $editions) {
     13    $edLoc = [System.IO.Path]::Combine($loc, $edition, "MSBuild")
     14    Foreach ($version in $versions) {
     15      $binLoc = [System.IO.Path]::Combine($edLoc, $version, "Bin")
     16      $loc64 = [System.IO.Path]::Combine($binLoc, "amd64", "MSBuild.exe")
     17      $loc32 = [System.IO.Path]::Combine($binLoc, "MSBuild.exe")
     18
     19      If ([System.IO.File]::Exists($loc64)) {
     20        $msBuildPath = $loc64
     21        $vstestPath = [System.IO.Path]::Combine($loc, $edition, "Common7", "IDE", "CommonExtensions", "Microsoft", "TestWindow", "vstest.console.exe")
     22        Break search;
     23      }
     24      If ([System.IO.File]::Exists($loc32)) {
     25        $msBuildPath = $loc32
     26        $vstestPath = [System.IO.Path]::Combine($loc, $edition, "Common7", "IDE", "CommonExtensions", "Microsoft", "TestWindow", "vstest.console.exe")
     27        Break search;
     28      }
     29    }
    1530  }
    1631}
     
    1833If ($vstestPath -eq $undefined) {
    1934  "Could not locate vstest.console.exe, ABORTING ..."
     35  Return
     36}
     37
     38If(-not [System.IO.File]::Exists($vstestPath)) {
     39  "vstest.console.exe is not found at $vstestPath, ABORTING ..."
    2040  Return
    2141}
     
    3959
    4060If($dobuild) {
    41 
    42   $msBuildPath = $undefined
    43   Foreach ($loc in $locations) {
    44     $msbuildloc64 = [System.IO.Path]::Combine($loc, "MSBuild", "15.0", "Bin", "amd64", "MSBuild.exe")
    45     $msbuildloc32 = [System.IO.Path]::Combine($loc, "MSBuild", "15.0", "Bin", "MSBuild.exe")
    46     If ([System.IO.File]::Exists($msbuildloc64)) {
    47       $msBuildPath = $msbuildloc64
    48       Break;
    49     } ElseIf ([System.IO.File]::Exists($msbuildloc32)) {
    50       $msBuildPath = $msbuildloc32
    51       Break;
    52     }
    53   }
    54  
    55   If ($msBuildPath -eq $undefined) {
    56     "Could not locate MSBuild, ABORTING ..."
    57     Return
    58   }
    59 
    6061  $curPath = $MyInvocation.MyCommand.Path
    6162  $curDir = Split-Path $curPath
Note: See TracChangeset for help on using the changeset viewer.