Skip to content

Commit

Permalink
Enable appveyor successful execution.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmienk committed Nov 23, 2016
1 parent 443fac5 commit 67007d4
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 7 deletions.
14 changes: 7 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ matrix:
fast_finish: true

skip_tags: true
clone_folder: c:\projects\bc
clone_folder: c:\git\libbitcoin

before_build:
- cd c:\projects\bc\builds\msvc\vs2013
- nuget restore

- mkdir c:\nuget
- nuget restore c:\git\libbitcoin\builds\msvc\vs2013\libbitcoin.sln -Outputdir c:\nuget
- powershell c:\git\libbitcoin\prebuild_ctp_install.ps1

build:
parallel: true
project: c:\projects\bc\builds\msvc\vs2013\libbitcoin.sln
project: c:\git\libbitcoin\builds\msvc\vs2013\libbitcoin.sln

test_script:
- c:\projects\bc\bin\x64\Release\v120\static\libbitcoin-test.exe

- powershell c:\git\libbitcoin\libbitcoin_test_runner.ps1

29 changes: 29 additions & 0 deletions libbitcoin_test_runner.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$BIN_PATH = "c:\git\libbitcoin\bin"
$TEST_EXE_NAME = "libbitcoin-test.exe"
$TEST_ARGS = "--run_test=* --show_progress=no --detect_memory_leak=0 --report_level=no --build_info=yes"

Write-Host "Locating test executables..." -ForegroundColor Cyan

$DISCOVERED_EXES = @(Get-ChildItem -Path $BIN_PATH -recurse | Where-Object { $_.Name -eq $TEST_EXE_NAME })

If ($DISCOVERED_EXES.Count -ne 1) {
Write-Host "Failure, invalid count of test elements" -ForegroundColor Red
exit 1
}

Write-Host "Found single instance: " $DISCOVERED_EXES.Name -ForegroundColor Cyan

$DISCOVERED_EXES.FullName | ForEach-Object {
Write-Host "Executing $_ $TEST_ARGS" -ForegroundColor Cyan
try {
Invoke-Expression "$_ $TEST_ARGS"
}
catch {
$error = $_
Write-Host "Failure executing tests: " $error -ForegroundColor Red
exit $error
}
}

Write-Host "Complete." -ForegroundColor Green

25 changes: 25 additions & 0 deletions prebuild_ctp_install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function GetUninstallString($productName) {
$x64items = @(Get-ChildItem "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
($x64items + @(Get-ChildItem "HKLM:SOFTWARE\wow6432node\Microsoft\Windows\CurrentVersion\Uninstall") `
| ForEach-object { Get-ItemProperty Microsoft.PowerShell.Core\Registry::$_ } `
| Where-Object { $_.DisplayName -and $_.DisplayName.Contains($productName) } `
| Select UninstallString).UninstallString
}

Write-Host "Uninstalling Microsoft Visual C++ 2013 Redistributable (x64)..."
"$(GetUninstallString "Microsoft Visual C++ 2013 Redistributable (x64)") /quiet" | out-file "$env:temp\uninstall.cmd" -Encoding ASCII
& $env:temp\uninstall.cmd

Write-Host "Uninstalling Microsoft Visual C++ 2013 Redistributable (x86)..."
"$(GetUninstallString "Microsoft Visual C++ 2013 Redistributable (x86)") /quiet" | out-file "$env:temp\uninstall.cmd" -Encoding ASCII
& $env:temp\uninstall.cmd

Write-Host "Downloading Visual C++ Compiler November 2013 CTP..." -ForegroundColor Cyan
$exePath = "$($env:TEMP)\vc_CompilerCTP.Nov2013.exe"
(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/3/C/2/3C271B79-6354-4B66-9014-C6CEBC14C5C4/vc_CompilerCTP.Nov2013.exe', $exePath)

Write-Host "Installing..."
cmd /c start /wait $exePath /install /quiet /norestart /log c:\users\appveyor\install-log.txt

Write-Host "Installed" -ForegroundColor green

0 comments on commit 67007d4

Please sign in to comment.