diff options
author | Brad King <brad.king@kitware.com> | 2013-05-22 17:05:47 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-05-22 17:05:47 (GMT) |
commit | 12eab7420d011febecb181375cdbd1c276bba1b0 (patch) | |
tree | 12d1f596b7265044024e78ccde1ac5840179bd00 | |
parent | 2da5b51b0c92b99a9b335f2d05dcdc115b8920ac (diff) | |
parent | db4350232639d9356c4bf5af6a91d71e5d45c93e (diff) | |
download | CMake-12eab7420d011febecb181375cdbd1c276bba1b0.zip CMake-12eab7420d011febecb181375cdbd1c276bba1b0.tar.gz CMake-12eab7420d011febecb181375cdbd1c276bba1b0.tar.bz2 |
Merge topic 'ctest-parallel-env'
db43502 CTest: Read CTEST_PARALLEL_LEVEL from environment
-rw-r--r-- | Source/cmCTest.cxx | 11 | ||||
-rw-r--r-- | Source/cmCTest.h | 1 | ||||
-rw-r--r-- | Source/ctest.cxx | 3 |
3 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 9a042c4..69ffb97 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -294,6 +294,7 @@ cmCTest::cmCTest() { this->LabelSummary = true; this->ParallelLevel = 1; + this->ParallelLevelSetInCli = false; this->SubmitIndex = 0; this->Failover = false; this->BatchJobs = false; @@ -1999,11 +2000,13 @@ void cmCTest::HandleCommandLineArguments(size_t &i, i++; int plevel = atoi(args[i].c_str()); this->SetParallelLevel(plevel); + this->ParallelLevelSetInCli = true; } else if(arg.find("-j") == 0) { int plevel = atoi(arg.substr(2).c_str()); this->SetParallelLevel(plevel); + this->ParallelLevelSetInCli = true; } if(this->CheckArgument(arg, "--no-compress-output")) @@ -2398,6 +2401,14 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) } } // the close of the for argument loop + if (!this->ParallelLevelSetInCli) + { + if (const char *parallel = cmSystemTools::GetEnv("CTEST_PARALLEL_LEVEL")) + { + int plevel = atoi(parallel); + this->SetParallelLevel(plevel); + } + } // now what sould cmake do? if --build-and-test was specified then // we run the build and test handler and return diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 587a6db..5dd35ce 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -485,6 +485,7 @@ private: int MaxTestNameWidth; int ParallelLevel; + bool ParallelLevelSetInCli; int CompatibilityMode; diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 285ec17..e767a16 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -71,7 +71,8 @@ static const char * cmDocumentationOptions[][3] = {"-j <jobs>, --parallel <jobs>", "Run the tests in parallel using the" "given number of jobs.", "This option tells ctest to run the tests in parallel using given " - "number of jobs."}, + "number of jobs. This option can also be set by setting " + "the environment variable CTEST_PARALLEL_LEVEL."}, {"-Q,--quiet", "Make ctest quiet.", "This option will suppress all the output. The output log file will " "still be generated if the --output-log is specified. Options such " |