Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout config options #772

Merged
merged 1 commit into from Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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