Skip to content

Commit 00e8614

Browse files
committed
add .exe suffix to retdec-decompiler tool on windows
1 parent 489a5f8 commit 00e8614

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Changelog
22

3+
* 2020-06-04: Change: use `retdec-decompiler[.exe]` instead of `retdec-decompiler.py`.
34
* 2020-04-08: Change: Removed support for the following features that are no longer useful: storing results into a database, showing results on the web, sending email notifications, building of RetDec, resuming tests run, testing a specific commit.
45
* 2019-09-04: Enhancement: Add support for skipping tests that compile output C files (either via config or via the `--skip-c-compilation-tests` parameter of `runner.py`).
56
* 2019-03-11: Change: Removed mention of 32-bit Windows (it is no longer supported). Added a new requirement for Windows: 64-bit GCC compiler (package `mingw-w64-x86_64-gcc`).

regression_tests/cmd_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ def __init__(self, **kwargs):
152152
# Python scripts need to be run with 'python' on Windows. Simply running the
153153
# script by its path doesn't work. That is, for example, instead of
154154
#
155-
# /path/to/retdec-decompiler.py
155+
# /path/to/script.py
156156
#
157157
# we need to run
158158
#
159-
# python /path/to/retdec-decompiler.py
159+
# python /path/to/script.py
160160
#
161161
if 'args' in kwargs and kwargs['args'] and kwargs['args'][0].endswith('.py'):
162162
kwargs['args'].insert(0, sys.executable)

regression_tests/tools/decompiler_runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from regression_tests.tools.decompiler import Decompiler
66
from regression_tests.tools.tool_runner import ToolRunner
77
from regression_tests.utils import overrides
8+
from regression_tests.utils.os import on_windows
89

910

1011
class DecompilerRunner(ToolRunner):
@@ -17,7 +18,7 @@ def _tool_class(self):
1718

1819
@overrides(ToolRunner)
1920
def _get_tool_executable_name(self, tool_name):
20-
return 'retdec-decompiler'
21+
return 'retdec-decompiler' + ('.exe' if on_windows() else '')
2122

2223
@overrides(ToolRunner)
2324
def _initialize_tool_dir_and_args(self, dir, args):

runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def ensure_all_required_settings_are_set(config):
7676
print_error("'retdec_install_dir' in the [runner] section of config_local.ini "
7777
"points to a non-existing directory")
7878
sys.exit(1)
79-
elif not os.path.exists(os.path.join(retdec_install_dir, 'bin', 'retdec-decompiler')):
79+
elif not (os.path.exists(os.path.join(retdec_install_dir, 'bin', 'retdec-decompiler'))
80+
or os.path.exists(os.path.join(retdec_install_dir, 'bin', 'retdec-decompiler.exe'))):
8081
print_error("'retdec_install_dir' in the [runner] section of config_local.ini "
8182
"does not seem to point to RetDec")
8283
sys.exit(1)

tests/tools/decompiler_runner_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from regression_tests.tools.decompiler_arguments import DecompilerArguments
1212
from regression_tests.tools.decompiler_runner import DecompilerRunner
1313
from regression_tests.tools.tool_test_settings import ToolTestSettings
14+
from regression_tests.utils.os import on_windows
1415

1516

1617
class DecompilerRunnerTests(unittest.TestCase):
@@ -32,7 +33,7 @@ def test_tool_class_returns_decompilation(self):
3233
def test_get_tool_executable_name_returns_correct_name(self):
3334
self.assertEqual(
3435
self.decomp_runner._get_tool_executable_name('decompiler'),
35-
'retdec-decompiler'
36+
'retdec-decompiler.exe' if on_windows() else 'retdec-decompiler'
3637
)
3738

3839
def test_initialize_tool_dir_and_args_just_returns_args_when_config_file_is_not_set(self):

0 commit comments

Comments
 (0)