Implement builders to build Boost from source code
This commit is contained in:
69
tests/Windows.Tests.ps1
Normal file
69
tests/Windows.Tests.ps1
Normal file
@@ -0,0 +1,69 @@
|
||||
param (
|
||||
[Version] $Version,
|
||||
[String] $Platform
|
||||
)
|
||||
|
||||
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
|
||||
Import-Module (Join-Path $PSScriptRoot "../helpers/win-vs-env.psm1")
|
||||
|
||||
Set-Location -Path "sources"
|
||||
|
||||
$env:Path="$env:Path;${env:BOOST_ROOT}\lib"
|
||||
|
||||
Write-Host "Initialize VS dev environment"
|
||||
Invoke-VSDevEnvironment
|
||||
|
||||
Describe "Windows Tests" {
|
||||
It "Run simple code" {
|
||||
"cl -nologo /EHsc -I ${env:BOOST_ROOT}\include main.cpp" | Should -ReturnZeroExitCode
|
||||
".\main.exe" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Build with static libraries 1" {
|
||||
$buildArguments = @(
|
||||
"/EHsc",
|
||||
"/I", "${env:BOOST_ROOT}\include",
|
||||
"main-headers.cpp",
|
||||
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib",
|
||||
"/OUT:main_static_lib_1.exe"
|
||||
)
|
||||
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode
|
||||
".\main_static_lib_1.exe" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Build with dynamic libraries 1" {
|
||||
$buildArguments = @(
|
||||
"/EHsc", "/MD",
|
||||
"/I", "${env:BOOST_ROOT}\include",
|
||||
"main-headers.cpp",
|
||||
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib",
|
||||
"/OUT:main_dynamic_lib_1.exe"
|
||||
)
|
||||
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode
|
||||
".\main_dynamic_lib_1.exe" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Build with static libraries 2" {
|
||||
$buildArguments = @(
|
||||
"/EHsc",
|
||||
"/I", "${env:BOOST_ROOT}\include",
|
||||
"main_log.cpp",
|
||||
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib",
|
||||
"/OUT:main_static_lib_2.exe"
|
||||
)
|
||||
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode
|
||||
".\main_static_lib_2.exe" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Build with dynamic libraries 2" {
|
||||
$buildArguments = @(
|
||||
"/EHsc", "/MD",
|
||||
"/I", "${env:BOOST_ROOT}\include",
|
||||
"main_log.cpp",
|
||||
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib",
|
||||
"/OUT:main_dynamic_lib_2.exe"
|
||||
)
|
||||
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode
|
||||
".\main_dynamic_lib_2.exe" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user