8000 Check tcltk for any platform and version · actions/python-versions@3aae833 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3aae833

Browse files
committed
Check tcltk for any platform and version
1 parent 045abfc commit 3aae833

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

tests/python-tests.ps1

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,22 @@ Describe "Tests" {
4545
$pythonLocation.startsWith($expectedPath) | Should -BeTrue
4646
}
4747

48-
It "Run simple code" {
49-
"python ./sources/simple-test.py" | Should -ReturnZeroExitCode
48+
# linux has no display name and no $DISPLAY environment variable - skip tk test
49+
echo "Platform $Platform"
50+
echo $Platform -match "ubuntu"
51+
echo $Platform -match "linux"
52+
echo $Platform -match "ubuntu"
53+
echo $Platform -match "linux"
54+
echo ($Platform -match "ubuntu") -or ($Platform -match "linux")
55+
echo -not (($Platform -match "ubuntu") -or ($Platform -match "linux"))
56+
if (-not (($Platform -match "ubuntu") -or ($Platform -match "linux"))) {
57+
It "Run simple code" {
58+
"python ./sources/simple-test.py" | Should -ReturnZeroExitCode
59+
}
60+
}
61+
62+
It "Check if tcl/tk has the same headed and library versions" {
63+
"python ./sources/tcltk.py" | Should -ReturnZeroExitCode
5064
}
5165

5266
if (($Version -ge "3.2.0") -and -not ([semver]"$($Version.Major).$($Version.Minor)" -eq [semver]"3.11" -and $Version.PreReleaseLabel)) {
@@ -89,12 +103,4 @@ Describe "Tests" {
89103
"./dist/simple-test" | Should -ReturnZeroExitCode
90104
}
91105
}
92-
93-
if (($Platform -match "macos") -or ($Platform -match "darwin")) {
94-
if ($Version -gt "3.7.12" ) {
95-
It "Check if python above 3.7.12 use tcl/tk v8.6" {
96-
"python ./sources/tcltk-86.py" | Should -ReturnZeroExitCode
97-
}
98-
}
99-
}
100106
}

tests/sources/tcltk-86.py renamed to tests/sources/tcltk.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
header = _tkinter.TK_VERSION
55
lib = tkinter.Tk().getvar('tk_version')
66

7-
print('header version=' + header)
8-
print('lib version=' + lib)
9-
10-
if lib != '8.6' or header != '8.6':
7+
if lib != header:
8+
print('header version=' + header)
9+
print('lib version=' + lib)
1110
exit(1)

0 commit comments

Comments
 (0)
0