Skip to content

Commit

Permalink
Add timeout config options
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDenisov committed Oct 13, 2020
1 parent 1acba51 commit c3f1069
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/generated/CLIOptions.rst
@@ -1,5 +1,7 @@
--workers number How many threads to use

--timeout number Timeout per test run (milliseconds)

--dry-run Skips real mutants execution. Disabled by default

--cache-dir directory Where to store cache (defaults to /tmp/mull-cache)
Expand Down Expand Up @@ -36,6 +38,8 @@

--compilation-flags string Extra compilation flags for junk detection

--ld-preload library Load the given libraries before dynamic linking

--ld-search-path directory Library search path

--include-path regex File/directory paths to whitelist (supports regex)
Expand Down
10 changes: 10 additions & 0 deletions tools/mull-cxx/CLIOptions.cpp
@@ -1,4 +1,5 @@
#include "CLIOptions.h"
#include <mull/Config/Configuration.h>
#include <mull/Mutators/Mutator.h>
#include <mull/Reporters/IDEReporter.h>
#include <mull/Reporters/MutationTestingElementsReporter.h>
Expand Down Expand Up @@ -27,6 +28,14 @@ opt<unsigned> tool::Workers(
value_desc("number"),
cat(MullCXXCategory));

opt<unsigned> tool::Timeout(
"timeout",
desc("Timeout per test run (milliseconds)"),
Optional,
value_desc("number"),
init(MullDefaultTimeoutMilliseconds),
cat(MullCXXCategory));

opt<std::string> tool::ReportDirectory(
"report-dir",
desc("Where to store report (defaults to '.')"),
Expand Down Expand Up @@ -340,6 +349,7 @@ void tool::dumpCLIInterface(Diagnostics &diagnostics) {
Option *reporters = &(Option &)ReportersOption;
std::vector<Option *> mullOptions({
&Workers,
&Timeout,
&DryRunOption,

&CacheDir,
Expand Down
1 change: 1 addition & 0 deletions tools/mull-cxx/CLIOptions.h
Expand Up @@ -20,6 +20,7 @@ extern OptionCategory MullCXXCategory;
extern opt<std::string> InputFile;

extern opt<unsigned> Workers;
extern opt<unsigned> Timeout;

extern opt<std::string> ReportName;
extern opt<std::string> ReportDirectory;
Expand Down
2 changes: 2 additions & 0 deletions tools/mull-cxx/mull-cxx.cpp
Expand Up @@ -91,6 +91,8 @@ int main(int argc, char **argv) {
configuration.customTests.push_back(mull::CustomTestDefinition("main", "_main", "mull", {}));
configuration.failFastEnabled = true;

configuration.timeout = tool::Timeout.getValue();

if (tool::Workers) {
mull::ParallelizationConfig parallelizationConfig;
parallelizationConfig.workers = tool::Workers;
Expand Down

0 comments on commit c3f1069

Please sign in to comment.