While tasty allows to configure OptionSet at any level of test tree, it often has any effect only on options of test providers (class IsTest). But test runners and reporters typically only look into the OptionSet they were given as an argument. This is not unreasonable: e. g., if an option is a log filename you cannot expect to change it in the middle of the run. It is however too restrictive: there is no way to use defaultMain but hardcode a global option, without passing it via command line.
applyTopLevelPlusTestOptions allows for a compromise: unwrap top-level PlusTestOptions from the TestTree and apply them to the OptionSet from command line. This way a user can wrap their tests in adjustOption / localOption forcing, for instance, NumThreads to 1.
While tasty allows to configure
OptionSet
at any level of test tree, it often has any effect only on options of test providers (class IsTest
). But test runners and reporters typically only look into theOptionSet
they were given as an argument. This is not unreasonable: e. g., if an option is a log filename you cannot expect to change it in the middle of the run. It is however too restrictive: there is no way to usedefaultMain
but hardcode a global option, without passing it via command line.applyTopLevelPlusTestOptions
allows for a compromise: unwrap top-levelPlusTestOptions
from theTestTree
and apply them to theOptionSet
from command line. This way a user can wrap their tests inadjustOption
/localOption
forcing, for instance,NumThreads
to 1.Related to #406 and #414.