From ca8c459e79f00c935cd996e9a300b91d84e6f4be Mon Sep 17 00:00:00 2001 From: pit-ray Date: Tue, 13 Jun 2023 10:36:20 +0900 Subject: [PATCH] fix test --- tests/runtime/checks/window.py | 19 ------------------- tests/runtime/handler.py | 18 ++++++------------ tests/unit/alone/CMakeLists.txt | 1 - 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/tests/runtime/checks/window.py b/tests/runtime/checks/window.py index 0490a80e..c51258eb 100644 --- a/tests/runtime/checks/window.py +++ b/tests/runtime/checks/window.py @@ -7,7 +7,6 @@ def get_cases(): increase_window_width, resize_window_height, snap_current_window_to_right, - window_resizer ] @@ -52,21 +51,3 @@ def snap_current_window_to_right(handler, mock_app): target_h = sh return w == target_w and h == target_h - - -def window_resizer(handler, mock_app): - mock_app.focus() - - x1, y1 = mock_app.get_window_pos() - w1, h1 = mock_app.get_window_size() - - # [winresizer] a user-defined macro defined in vindrc_gen.py. - # [ll] increate width in resize mode - # [e] change mode to move mode - # [jj] Down the y coordinate of the window - # [] Exit windowresizer - handler.send_command('winresizerllejj', pause=2) - x2, y2 = mock_app.get_window_pos() - w2, h2 = mock_app.get_window_size() - - return w1 < w2 and h1 == h2 and x1 == x2 and y1 < y2 diff --git a/tests/runtime/handler.py b/tests/runtime/handler.py index fc9d32e4..c0a16d31 100644 --- a/tests/runtime/handler.py +++ b/tests/runtime/handler.py @@ -4,7 +4,8 @@ import subprocess from glob import glob from functools import lru_cache -from shutil import copyfile +from distutils.dir_util import copy_tree +import shutil from vindrc_gen import VINDRC_GEN @@ -37,22 +38,15 @@ def setup_environment(self): # Copy win-vind binary into the temporary directory. dest_exe_path = os.path.join(self.env_root, 'win-vind.exe') if not os.path.isfile(dest_exe_path): - copyfile(self.exe_path, dest_exe_path) + shutil.copyfile(self.exe_path, dest_exe_path) # Copy the resource files into the temporary directory. resource_dir = os.path.join(self.env_root, 'resources') os.makedirs(resource_dir, exist_ok=True) - source_resource_query = os.path.join( - os.path.dirname(self.exe_path), 'resources', '*') - resource_files = glob(source_resource_query) - - for filename in resource_files: - dest_path = os.path.join( - resource_dir, os.path.basename(filename)) - - if not os.path.isfile(dest_path): - copyfile(filename, dest_path) + copy_tree( + os.path.join(os.path.dirname(self.exe_path), 'resources'), + resource_dir) # Set the install type as portable. instype_file = os.path.join(resource_dir, '.instype') diff --git a/tests/unit/alone/CMakeLists.txt b/tests/unit/alone/CMakeLists.txt index df1237ae..ff736f4b 100644 --- a/tests/unit/alone/CMakeLists.txt +++ b/tests/unit/alone/CMakeLists.txt @@ -48,7 +48,6 @@ AddTest(each-mapsolver-test ${CMAKE_CURRENT_SOURCE_DIR}/mapsolver_test.cpp ${SRCDIR}/bind/bindedfunc.cpp - ${SRCDIR}/bind/mapdefault.cpp ${SRCDIR}/core/cmdmatcher.cpp ${SRCDIR}/core/cmdparser.cpp ${SRCDIR}/core/cmdunit.cpp