Test branch (#2)

This commit is contained in:
Nikita Bykov
2020-09-08 11:22:39 +03:00
committed by GitHub
parent 5d5ff87b28
commit dc8da2cb3a
5 changed files with 124 additions and 101 deletions

View File

@@ -1,18 +1,15 @@
param (
[Version] $Version,
[String] $Platform
)
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
Set-Location "sources"
$env:Path="$env:Path;${env:BOOST_ROOT}\lib"
BeforeAll {
Set-Location "sources"
$env:Path="$env:Path;${env:BOOST_ROOT}\lib"
if (${env:PLATFORM} -eq "linux-16.04") {
Write-Host "Install dependencies"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 `
--slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc
}
if ($Platform -eq "linux-16.04") {
Write-Host "Install dependencies"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 `
--slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc
}
Describe "Nix Tests" {
@@ -33,10 +30,10 @@ Describe "Nix Tests" {
"-w", "-DBOOST_LOG_DYN_LINK",
"-I", "${env:BOOST_ROOT}/include",
"-L", "${env:BOOST_ROOT}/lib", "main_log.cpp",
"-l:libboost_log_setup-mt-d-x64.so.${Version}",
"-l:libboost_log-mt-d-x64.so.${Version}",
"-l:libboost_thread-mt-d-x64.so.${Version}",
"-l:libboost_filesystem-mt-d-x64.so.${Version}",
"-l:libboost_log_setup-mt-d-x64.so.${env:VERSION}",
"-l:libboost_log-mt-d-x64.so.${env:VERSION}",
"-l:libboost_thread-mt-d-x64.so.${env:VERSION}",
"-l:libboost_filesystem-mt-d-x64.so.${env:VERSION}",
"-lpthread"
)
@@ -49,10 +46,10 @@ Describe "Nix Tests" {
"-w", "-DBOOST_LOG_DYN_LINK",
"-I", "${env:BOOST_ROOT}/include",
"-L", "${env:BOOST_ROOT}/lib", "main_log.cpp",
"-l:libboost_log_setup-mt-x64.so.${Version}",
"-l:libboost_log-mt-x64.so.${Version}",
"-l:libboost_thread-mt-x64.so.${Version}",
"-l:libboost_filesystem-mt-x64.so.${Version}",
"-l:libboost_log_setup-mt-x64.so.${env:VERSION}",
"-l:libboost_log-mt-x64.so.${env:VERSION}",
"-l:libboost_thread-mt-x64.so.${env:VERSION}",
"-l:libboost_filesystem-mt-x64.so.${env:VERSION}",
"-lpthread"
)

View File

@@ -1,17 +1,14 @@
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"
BeforeAll {
Set-Location -Path "sources"
$env:Path="$env:Path;${env:BOOST_ROOT}\lib"
$env:Path="$env:Path;${env:BOOST_ROOT}\lib"
Write-Host "Initialize VS dev environment"
Invoke-VSDevEnvironment
Write-Host "Initialize VS dev environment"
Invoke-VSDevEnvironment
}
Describe "Windows Tests" {
It "Run simple code" {
@@ -24,7 +21,7 @@ Describe "Windows Tests" {
"/EHsc",
"/I", "${env:BOOST_ROOT}\include",
"main-headers.cpp",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib"
"/OUT:main_static_lib_1.exe"
)
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode
@@ -36,7 +33,7 @@ Describe "Windows Tests" {
"/EHsc", "/MD",
"/I", "${env:BOOST_ROOT}\include",
"main-headers.cpp",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib"
"/OUT:main_dynamic_lib_1.exe"
)
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode
@@ -48,7 +45,7 @@ Describe "Windows Tests" {
"/EHsc",
"/I", "${env:BOOST_ROOT}\include",
"main_log.cpp",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib"
"/OUT:main_static_lib_2.exe"
)
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode
@@ -60,7 +57,7 @@ Describe "Windows Tests" {
"/EHsc", "/MD",
"/I", "${env:BOOST_ROOT}\include",
"main_log.cpp",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib"
"/OUT:main_dynamic_lib_2.exe"
)
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode