You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Welcome to Regression Tests' Documentation!
8
8
9
9
This is a documentation for the `regression tests framework <https://github.com/avast/retdec-regression-tests-framework/>`_. It describes how to write regression tests for `RetDec <https://github.com/avast/retdec/>`_ and its tools, and provides an overview of the supported functions and methods.
10
10
11
-
The documentation is primarily focused on tests for the RetDec decompiler, i.e. for the ``retdec-decompiler.py`` script. You can, however, write tests for arbitrary RetDec-related tools, such as ``fileinfo`` or ``unpacker``. This is described in section :doc:`tests_for_arbitrary_tools`. Nevertheless, it is highly recommended to read the whole documentation, even if you plan to write tests only for a single tool.
11
+
The documentation is primarily focused on tests for the RetDec decompiler, i.e. for the ``retdec-decompiler`` script. You can, however, write tests for arbitrary RetDec-related tools, such as ``fileinfo`` or ``unpacker``. This is described in section :doc:`tests_for_arbitrary_tools`. Nevertheless, it is highly recommended to read the whole documentation, even if you plan to write tests only for a single tool.
Copy file name to clipboardExpand all lines: docs/test_settings.rst
+11-11
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,11 @@ The name can by any valid Python identifier, written conventionally in ``snake_c
27
27
arch='x86'
28
28
)
29
29
30
-
From the above settings, the following ``retdec-decompiler.py`` argument list is automatically created:
30
+
From the above settings, the following ``retdec-decompiler`` argument list is automatically created:
31
31
32
32
.. code-block:: text
33
33
34
-
retdec-decompiler.py file.exe -a x86
34
+
retdec-decompiler file.exe -a x86
35
35
36
36
For a complete list of possible arguments to the initializer, see the description of :class:`~tools.decompiler_test_settings.DecompilerTestSettings`.
37
37
@@ -48,8 +48,8 @@ For such settings, the following two decompilations are run:
48
48
49
49
.. code-block:: text
50
50
51
-
retdec-decompiler.py file.exe -a x86
52
-
retdec-decompiler.py file.exe -a arm
51
+
retdec-decompiler file.exe -a x86
52
+
retdec-decompiler file.exe -a arm
53
53
54
54
That is, the regression tests framework runs a single decompilation for every combination of the values specified in the settings.
55
55
@@ -122,7 +122,7 @@ We want to decompile ``file1.exe`` on ``x86`` and ``arm``, and ``file2.elf`` on
122
122
Arbitrary Parameters for the Decompiler
123
123
---------------------------------------
124
124
125
-
If you look at the complete list of possible arguments (:class:`~tools.decompiler_test_settings.DecompilerTestSettings`), you see that not all ``retdec-decompiler.py`` parameters may be specified as arguments to :class:`TestSettings`. The reason is that ``retdec-decompiler.py`` provides too many parameters and their support in the form of arguments would be cumbersome. However, it is possible to specify arbitrary arguments that are directly passed to the ``retdec-decompiler.py`` script via the ``args`` argument:
125
+
If you look at the complete list of possible arguments (:class:`~tools.decompiler_test_settings.DecompilerTestSettings`), you see that not all ``retdec-decompiler`` parameters may be specified as arguments to :class:`TestSettings`. The reason is that ``retdec-decompiler`` provides too many parameters and their support in the form of arguments would be cumbersome. However, it is possible to specify arbitrary arguments that are directly passed to the ``retdec-decompiler`` via the ``args`` argument:
126
126
127
127
.. code-block:: python
128
128
@@ -137,17 +137,17 @@ These settings result into the creation of the following decompilation:
137
137
138
138
.. code-block:: text
139
139
140
-
retdec-decompiler.py file.exe -a x86 --select-decode-only --select-functions func1,func2
140
+
retdec-decompiler file.exe -a x86 --select-decode-only --select-functions func1,func2
141
141
142
-
In a greater detail, the ``args`` argument is taken, split into sub-arguments by whitespace, and passed to the ``retdec-decompiler.py`` script. The argument list internally looks like this:
142
+
In a greater detail, the ``args`` argument is taken, split into sub-arguments by whitespace, and passed to the ``retdec-decompiler``. The argument list internally looks like this:
When it is possible to specify a ``retdec-decompiler.py`` parameter in the form of a named argument (like architecture or endianness), always prefer it to specifying raw arguments by using the ``args`` argument. That is, do **not** write
150
+
When it is possible to specify a ``retdec-decompiler`` parameter in the form of a named argument (like architecture or endianness), always prefer it to specifying raw arguments by using the ``args`` argument. That is, do **not** write
151
151
152
152
.. code-block:: python
153
153
@@ -157,7 +157,7 @@ In a greater detail, the ``args`` argument is taken, split into sub-arguments by
157
157
args='-a x86'# Always prefer using arch='x86'.
158
158
)
159
159
160
-
The reason is that named arguments are less prone to changes in ``retdec-decompiler.py``. Indeed, when such an argument changes in ``retdec-decompiler.py``, all that has to be done is changing the internal mapping of named arguments to ``retdec-decompiler.py`` arguments. No test needs to be changed.
160
+
The reason is that named arguments are less prone to changes in ``retdec-decompiler``. Indeed, when such an argument changes in ``retdec-decompiler``, all that has to be done is changing the internal mapping of named arguments to ``retdec-decompiler`` arguments. No test needs to be changed.
161
161
162
162
If you want to specify separate arguments for several decompilations for single settings, place them into a list when specifying the settings. For example, consider the following test class:
163
163
@@ -177,8 +177,8 @@ It results into these two decompilations:
177
177
178
178
.. code-block:: text
179
179
180
-
retdec-decompiler.py file.elf -a x86 --select-decode-only --select-functions func1,func2
181
-
retdec-decompiler.py file.elf -a x86 --select-decode-only --select-functions func3
180
+
retdec-decompiler file.elf -a x86 --select-decode-only --select-functions func1,func2
181
+
retdec-decompiler file.elf -a x86 --select-decode-only --select-functions func3
182
182
183
183
You can also specify multiple settings, as already described earlier in this section.
0 commit comments