Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/regression_test_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This provides the ReFrame internals with further control over the user's input,
In essence, these builtins exert control over the test creation, and they allow adding and/or modifying certain attributes of the regression test.


.. py:function:: reframe.core.pipeline.RegressionTest.parameter(values=None, inherit_params=False, filter_params=None)
.. py:function:: RegressionTest.parameter(values=None, inherit_params=False, filter_params=None)

Inserts or modifies a regression test parameter.
If a parameter with a matching name is already present in the parameter space of a parent class, the existing parameter values will be combined with those provided by this method following the inheritance behavior set by the arguments ``inherit_params`` and ``filter_params``.
Expand All @@ -67,7 +67,7 @@ In essence, these builtins exert control over the test creation, and they allow
else:
do_other()

One of the most powerful features about these built-in functions is that they store their input information at the class level.
One of the most powerful features about these built-in functions is that they store their input information at the class level.
However, a parameter may only be accessed from the class instance and accessing it directly from the class body is disallowed.
With this approach, extending or specializing an existing parametrized regression test becomes straightforward, since the test attribute additions and modifications made through built-in functions in the parent class are automatically inherited by the child test.
For instance, continuing with the example above, one could override the :func:`__init__` method in the :class:`Foo` regression test as follows:
Expand All @@ -83,7 +83,7 @@ In essence, these builtins exert control over the test creation, and they allow

Note that this built-in parameter function provides an alternative method to parameterize a test to :func:`reframe.core.decorators.parameterized_test`, and the use of both approaches in the same test is currently disallowed.
The two main advantages of the built-in :func:`parameter` over the decorated approach reside in the parameter inheritance across classes and the handling of large parameter sets.
As shown in the example above, the parameters declared with the built-in :func:`parameter` are automatically carried over into derived tests through class inheritance, whereas tests using the decorated approach would have to redefine the parameters on every test.
As shown in the example above, the parameters declared with the built-in :func:`parameter` are automatically carried over into derived tests through class inheritance, whereas tests using the decorated approach would have to redefine the parameters on every test.
Similarly, parameters declared through the built-in :func:`parameter` are regarded as fully independent from each other and ReFrame will automatically generate as many tests as available parameter combinations. This is a major advantage over the decorated approach, where one would have to manually expand the parameter combinations.
This is illustrated in the example below, consisting of a case with two parameters, each having two possible values.

Expand Down Expand Up @@ -114,11 +114,11 @@ In essence, these builtins exert control over the test creation, and they allow
This only has an effect if used with ``inherit_params=True``.


.. py:function:: reframe.core.pipeline.RegressionTest.variable(*types, value=None)
.. py:function:: RegressionTest.variable(*types, value=None)

Inserts a new regression test variable.
Declaring a test variable through the :func:`variable` built-in allows for a more robust test implementation than if the variables were just defined as regular test attributes (e.g. ``self.a = 10``).
Using variables declared through the :func:`variable` built-in guarantees that these regression test variables will not be redeclared by any child class, while also ensuring that any values that may be assigned to such variables comply with its original declaration.
Using variables declared through the :func:`variable` built-in guarantees that these regression test variables will not be redeclared by any child class, while also ensuring that any values that may be assigned to such variables comply with its original declaration.
In essence, by using test variables, the user removes any potential test errors that might be caused by accidentally overriding a class attribute. See the example below.


Expand Down
211 changes: 122 additions & 89 deletions docs/tutorial_advanced.rst

Large diffs are not rendered by default.

Loading