|
22 | 22 | #include <unistd.h> |
23 | 23 | #endif |
24 | 24 |
|
| 25 | +#include <magic_enum/magic_enum.hpp> |
25 | 26 |
|
26 | 27 | //============================================================================== |
27 | 28 | static void exitWithError (const juce::String& error) |
@@ -285,6 +286,7 @@ static Option possibleOptions[] = |
285 | 286 | { "--sample-rates", true }, |
286 | 287 | { "--block-sizes", true }, |
287 | 288 | { "--vst3validator", true }, |
| 289 | + { "--rtcheck", false }, |
288 | 290 | }; |
289 | 291 |
|
290 | 292 | static juce::StringArray mergeEnvironmentVariables (juce::StringArray args, std::function<juce::String (const juce::String& name, const juce::String& defaultValue)> environmentVariableProvider = [] (const juce::String& name, const juce::String& defaultValue) { return juce::SystemStats::getEnvironmentVariable (name, defaultValue); }) |
@@ -362,6 +364,10 @@ static juce::String getHelpMessage() |
362 | 364 | << " Sets a timout which will stop validation with an error if no output from any" << newLine |
363 | 365 | << " test has happened for this number of ms." << newLine |
364 | 366 | << " By default this is 30s but can be set to \"-1\" (must be quoted) to never timeout." << newLine |
| 367 | + << " --rtcheck [empty, disabled, enabled or relaxed]" << newLine |
| 368 | + << " Turns on real-time saftey checks using rtcheck (macOS and Linux only)." << newLine |
| 369 | + << " relaxed mode doesn't run the checks for the first processing block as a lot of plugins" << newLine |
| 370 | + << " use this to allocate or initialise thread-locals (which can allocate)" << newLine |
365 | 371 | << newLine |
366 | 372 | // repeating tests |
367 | 373 | << " --repeat [num repeats]" << newLine |
@@ -552,6 +558,8 @@ std::pair<juce::String, PluginTests::Options> parseCommandLine (const juce::Argu |
552 | 558 | options.sampleRates = getSampleRates (args); |
553 | 559 | options.blockSizes = getBlockSizes (args); |
554 | 560 | options.vst3Validator = getOptionValue (args, "--vst3validator", "", "Expected a path for the --vst3validator option"); |
| 561 | + options.realtimeCheck = magic_enum::enum_cast<RealtimeCheck> (getOptionValue (args, "--rtcheck", "", "Expected one of [disabled, enabled, relaxed]").toString().toStdString()) |
| 562 | + .value_or (RealtimeCheck::disabled); |
555 | 563 |
|
556 | 564 | return { fileOrID, options }; |
557 | 565 | } |
@@ -622,6 +630,12 @@ juce::StringArray createCommandLine (juce::String fileOrID, PluginTests::Options |
622 | 630 | if (options.vst3Validator != juce::File()) |
623 | 631 | args.addArray ({ "--vst3validator", options.vst3Validator.getFullPathName().quoted() }); |
624 | 632 |
|
| 633 | + if (auto rtCheckMode = options.realtimeCheck; |
| 634 | + rtCheckMode != RealtimeCheck::disabled) |
| 635 | + { |
| 636 | + args.addArray ({ "--rtcheck", std::string (magic_enum::enum_name (rtCheckMode)) }); |
| 637 | + } |
| 638 | + |
625 | 639 | args.addArray ({ "--validate", fileOrID }); |
626 | 640 |
|
627 | 641 | return args; |
|
0 commit comments