mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added support for hex string arguments for the UnitTestRunner seed
This commit is contained in:
parent
133dc99b51
commit
d663ded1f5
1 changed files with 14 additions and 2 deletions
|
|
@ -65,8 +65,20 @@ int main (int argc, char **argv)
|
|||
|
||||
ConsoleUnitTestRunner runner;
|
||||
|
||||
auto seed = (args.containsOption ("--seed") ? args.getValueForOption ("--seed").getLargeIntValue()
|
||||
: Random::getSystemRandom().nextInt64());
|
||||
auto seed = [&args]
|
||||
{
|
||||
if (args.containsOption ("--seed"))
|
||||
{
|
||||
auto seedValueString = args.getValueForOption ("--seed");
|
||||
|
||||
if (seedValueString.startsWith ("0x"))
|
||||
return seedValueString.getHexValue64();
|
||||
|
||||
return seedValueString.getLargeIntValue();
|
||||
}
|
||||
|
||||
return Random::getSystemRandom().nextInt64();
|
||||
}();
|
||||
|
||||
if (args.containsOption ("--category"))
|
||||
runner.runTestsInCategory (args.getValueForOption ("--category"), seed);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue