add version compare

This commit is contained in:
Dmitry Shibanov
2020-10-13 19:56:27 +03:00
parent 6701f7c8b0
commit c4030498aa
2 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,7 @@ param (
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1") Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1") Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1")
Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")
function Analyze-MissingModules([string] $buildOutputLocation) { function Analyze-MissingModules([string] $buildOutputLocation) {
$searchStringStart = "Failed to build these modules:" $searchStringStart = "Failed to build these modules:"
@ -59,7 +60,8 @@ Describe "Tests" {
} }
It "Check if python configuration is correct" { It "Check if python configuration is correct" {
"python ./sources/python-config-test.py $Version" | Should -ReturnZeroExitCode $nativeVersion = Convert-Version -version $Version
"python ./sources/python-config-test.py $Version $nativeVersion" | Should -ReturnZeroExitCode
} }
It "Check if shared libraries are linked correctly" { It "Check if shared libraries are linked correctly" {

View File

@ -1,4 +1,5 @@
import distutils.sysconfig import distutils.sysconfig
from distutils.version import StrictVersion
import sysconfig import sysconfig
import sys import sys
import platform import platform
@ -7,6 +8,7 @@ import os
# Define variables # Define variables
os_type = platform.system() os_type = platform.system()
version = sys.argv[1] version = sys.argv[1]
nativeVersion = sys.argv[2]
lib_dir_path = sysconfig.get_config_var('LIBDIR') lib_dir_path = sysconfig.get_config_var('LIBDIR')
ld_library_name = sysconfig.get_config_var('LDLIBRARY') ld_library_name = sysconfig.get_config_var('LDLIBRARY')
@ -41,7 +43,7 @@ else:
### Validate macOS ### Validate macOS
if os_type == 'Darwin': if os_type == 'Darwin':
### Validate openssl links ### Validate openssl links
if version < "3.7.0": if StrictVersion(nativeVersion) < StrictVersion("3.7.0"):
expected_ldflags = '-L/usr/local/opt/openssl@1.1/lib' expected_ldflags = '-L/usr/local/opt/openssl@1.1/lib'
ldflags = sysconfig.get_config_var('LDFLAGS') ldflags = sysconfig.get_config_var('LDFLAGS')