diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-05-17 13:26:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-05-21 19:27:09 (GMT) |
commit | db4350232639d9356c4bf5af6a91d71e5d45c93e (patch) | |
tree | bb5b7a666e2509c1e2df8bc2751c20e74a50375c /Source/cmCTest.cxx | |
parent | edeabd18e6db5a52b2191ea9d3b09ee8bd090af6 (diff) | |
download | CMake-db4350232639d9356c4bf5af6a91d71e5d45c93e.zip CMake-db4350232639d9356c4bf5af6a91d71e5d45c93e.tar.gz CMake-db4350232639d9356c4bf5af6a91d71e5d45c93e.tar.bz2 |
CTest: Read CTEST_PARALLEL_LEVEL from environment
If no explicit "-j <n>" option is given on the command line then read
the parallel level from an environment variable.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 11 |
1 files changed, 11 insertions, 0 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 |