December 18

On Tuesday, 17 December 2024 at 21:31:13 UTC, DLearner wrote:

[... environmental requirements]

>

I regard that as something that is the programmer's responsibility [perhaps by writing a script that performs those tasks, and calling that script within the unittest].

This holds for the requirments inside the code of the unit too: by adding a routine for the preferred re-initialization of the unit---wrapped by `version( unittest)'.

For the example presented the line of code
| version( unittest) var1= 1;
would suffice, if correctly placed into the function.

-manfred

January 08

On Wednesday, 18 December 2024 at 07:43:01 UTC, Jonathan M Davis wrote:
[...]

>
  • Jonathan M Davis

Thinking about this a little more:

Suggestion:

Leave the current behaviour as default, but introduce an option (-r ?) so that

unittest -r {


}

forces a complete rebuild
(for clarity, if the function under test has updated data files, etc., it is the programmers responsibility that the unittest contains a script that resets those files).

The motive for all this is to address the situation where the function under test is not small, but is the top (or near top) of a complex system wih lots of state,
and the task is to create a test suite that clearly shows that multiple situations, involving state, have indeed been tested.

1 2
Next ›   Last »