fuzzer: add an -l option, so it loops until it crashes
This commit is contained in:
@@ -48,6 +48,9 @@ int main(int argc, char **argv)
|
|||||||
QCommandLineOption forceDumpJsonOption("f", QCoreApplication::translate("main", "Dump json of the test even if we're already loading a test."));
|
QCommandLineOption forceDumpJsonOption("f", QCoreApplication::translate("main", "Dump json of the test even if we're already loading a test."));
|
||||||
parser.addOption(forceDumpJsonOption);
|
parser.addOption(forceDumpJsonOption);
|
||||||
|
|
||||||
|
QCommandLineOption loopOption("l", QCoreApplication::translate("main", "Loops until it crashes"));
|
||||||
|
parser.addOption(loopOption);
|
||||||
|
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
|
||||||
@@ -67,9 +70,13 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QTimer::singleShot(0, &fuzzer, [&fuzzer, filesToLoad] {
|
const bool loops = parser.isSet(loopOption);
|
||||||
|
|
||||||
|
QTimer::singleShot(0, &fuzzer, [&fuzzer, filesToLoad, loops] {
|
||||||
if (filesToLoad.isEmpty())
|
if (filesToLoad.isEmpty())
|
||||||
|
do {
|
||||||
fuzzer.fuzz({ 1, 10, true });
|
fuzzer.fuzz({ 1, 10, true });
|
||||||
|
} while(loops);
|
||||||
else
|
else
|
||||||
fuzzer.fuzz(filesToLoad);
|
fuzzer.fuzz(filesToLoad);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user