Skip to content

Commit

Permalink
add version compare
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Shibanov committed Oct 13, 2020
1 parent 6701f7c commit c403049
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/python-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ param (

Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1")
Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")

function Analyze-MissingModules([string] $buildOutputLocation) {
$searchStringStart = "Failed to build these modules:"
Expand Down Expand Up @@ -59,7 +60,8 @@ Describe "Tests" {
}

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" {
Expand Down
4 changes: 3 additions & 1 deletion tests/sources/python-config-test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import distutils.sysconfig
from distutils.version import StrictVersion
import sysconfig
import sys
import platform
Expand All @@ -7,6 +8,7 @@
# Define variables
os_type = platform.system()
version = sys.argv[1]
nativeVersion = sys.argv[2]

lib_dir_path = sysconfig.get_config_var('LIBDIR')
ld_library_name = sysconfig.get_config_var('LDLIBRARY')
Expand Down Expand Up @@ -41,7 +43,7 @@
### Validate macOS
if os_type == 'Darwin':
### Validate openssl links
if version < "3.7.0":
if StrictVersion(nativeVersion) < StrictVersion("3.7.0"):
expected_ldflags = '-L/usr/local/opt/[email protected]/lib'
ldflags = sysconfig.get_config_var('LDFLAGS')

Expand Down

0 comments on commit c403049

Please sign in to comment.