Skip to content

Commit 3ecfb54

Browse files
committed
Fix win10 testcase issues
1 parent 2eb7a93 commit 3ecfb54

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tests.8/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ else ifeq (${HOSTNAME},584VVL9L9XIZV8H)
3333
# This is win10 test server
3434
HOST ?=windows.x86_64
3535
PYVERS := 3.9 3.10 3.11 3.12 3.13 3.14
36-
PYTHONBIN := C:/Users/Administrator/AppData/Local/Programs/Python/PythonXY/python.exe
36+
PYTHONBIN := ~/v9-test/venv/XY/Scripts/python.exe
3737
else ifeq (${HOSTNAME},WIN7-1611171239)
3838
ifeq (${HOST},windows.x86)
3939
PYVERS := 3.7 3.8
@@ -58,7 +58,9 @@ ifneq ($(findstring ${PYVER},${PYVERS}),${PYVER})
5858
$(error "${PYVER}" not in supported Python versions "${PYVERS}")
5959
endif
6060

61-
ifeq (${HOST},windows.x86_64)
61+
ifeq (${HOSTNAME},584VVL9L9XIZV8H)
62+
PYTHON ?= $(subst XY,${PYVER},${PYTHONBIN})
63+
else ifeq (${HOST},windows.x86_64)
6264
PYTHON ?= $(subst XY,$(subst .,,${PYVER}),${PYTHONBIN})
6365
else ifeq (${HOST},windows.x86)
6466
PYTHON ?= $(subst XY,$(subst .,,${PYVER}),${PYTHONBIN})
@@ -89,7 +91,7 @@ whlpath := $(shell (test -d ${whlpath} && echo ${whlpath}) || echo ./pkgdist)
8991
pkgfile := $(word 1,$(shell cd ${pkgpath}; ls -t pyarmor-*.tar.gz))
9092
testver := $(subst pyarmor-,,$(subst .tar.gz,,${pkgfile}))
9193
coreprefix := pyarmor_cli_core-
92-
coresuffix := -cp38-none-macosx_10_14_x86_64.whl
94+
coresuffix := -cp38-cp38-macosx_10_14_x86_64.whl
9395
corever=$(subst ${coreprefix},,$(subst ${coresuffix},,$(shell cd ${whlpath}; ls -t ${coreprefix}*${coresuffix})))
9496

9597
$(info got test package file: ${pkgfile})
@@ -112,8 +114,8 @@ install-%:
112114
@tar xzf ${pkgpath}/pyarmor-${testver}.tar.gz
113115
@mv pyarmor-${testver}/pyarmor .
114116
@rm -rf pyarmor-${testver}
115-
@unzip ${whlpath}/pyarmor_cli_core-${corever}-cp$(subst .,,$(subst install-,,$@))-none-${platform}.whl > /dev/null
116-
@(themida=../pyarmor_cli_core_themida-${corever}-cp$(subst .,,$(subst install-,,$@))-none-any.whl && test -f $$themida && unzip $$themida > /dev/null || echo no themida $$themida)
117+
@unzip ${whlpath}/pyarmor_cli_core-${corever}-cp$(subst .,,$(subst install-,,$@))-cp$(subst .,,$(subst install-,,$@))-${platform}.whl > /dev/null
118+
@(themida=../pyarmor_cli_core_themida-${corever}-cp$(subst .,,$(subst install-,,$@))-cp$(subst .,,$(subst install-,,$@))-any.whl && test -f $$themida && unzip $$themida > /dev/null || echo no themida $$themida)
117119
@rm -rf pyarmor_cli_core-${corever}.dist-info
118120

119121
atest:

tests.8/accept_test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
import logging
44
import os
55
import shutil
6-
import sys
76
import time
87
import unittest
98

109
from struct import calcsize
1110
from test.support import script_helper
1211

1312

13+
is_win7 = os.getenv('HOSTNAME', '').startswith('WIN7-')
14+
15+
1416
def metricmethod(func):
1517
if not hasattr(time, 'process_time'):
1618
time.process_time = time.clock
@@ -227,13 +229,13 @@ def test_bind_multiple_devices(self):
227229
self.pyarmor_gen(args)
228230
self.verify_dist_foo()
229231

230-
@unittest.skipUnless(sys.platform.startswith('win'), 'only for windows')
232+
@unittest.skipUnless(is_win7, 'only for windows 7')
231233
def test_themida_script(self):
232234
args = ['g', '--enable-themida', 'samples/foo.py']
233235
self.pyarmor_gen(args)
234236
self.verify_dist_foo()
235237

236-
@unittest.skipUnless(sys.platform.startswith('win'), 'only for windows')
238+
@unittest.skipUnless(is_win7, 'only for windows 7')
237239
def test_themida_bcc(self):
238240
args = ['g', '--enable-themida', '--enable-bcc', 'samples/foo.py']
239241
self.pyarmor_gen(args)

0 commit comments

Comments
 (0)