diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-03-26 17:37:25 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-03-26 17:37:25 (GMT) |
commit | f4bf694bae922e2c4a98a5f2125e1ae644d29cd1 (patch) | |
tree | fad400f75f2e275c648b7a2ae1c442a453b5b4d2 /Source/cmCreateTestSourceList.cxx | |
parent | 8d594bdccef2640904f246dcfd703cdc61c45f35 (diff) | |
download | CMake-f4bf694bae922e2c4a98a5f2125e1ae644d29cd1.zip CMake-f4bf694bae922e2c4a98a5f2125e1ae644d29cd1.tar.gz CMake-f4bf694bae922e2c4a98a5f2125e1ae644d29cd1.tar.bz2 |
ENH: if no arguments are given and there is only one test, then run it
Diffstat (limited to 'Source/cmCreateTestSourceList.cxx')
-rw-r--r-- | Source/cmCreateTestSourceList.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index 12096e6..4d729a9 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -20,7 +20,7 @@ // cmCreateTestSourceList bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn) { - if (argsIn.size() < 5) + if (argsIn.size() < 3) { this->SetError("called with wrong number of arguments."); return false; @@ -75,6 +75,9 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn) fout << " int i;\n"; fout << " if(ac < 2)\n"; fout << " {\n"; + fout << " // if there is only one test, then run it with the arguments\n"; + fout << " if(NumTests == 1)\n"; + fout << " { return (*cmakeGeneratedFunctionMapEntries[0].func)(ac, av); }\n"; fout << " printf(\"Available tests:\\n\");\n"; fout << " for(i =0; i < NumTests; ++i)\n"; fout << " {\n"; @@ -97,6 +100,9 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn) fout << " return (*cmakeGeneratedFunctionMapEntries[i].func)(ac-1, av+1);\n"; fout << " }\n"; fout << " }\n"; + fout << " // if there is only one test, then run it with the arguments\n"; + fout << " if(NumTests == 1)\n"; + fout << " { return (*cmakeGeneratedFunctionMapEntries[0].func)(ac, av); }\n"; fout << " printf(\"Available tests:\\n\");\n"; fout << " for(i =0; i < NumTests; ++i)\n"; fout << " {\n"; |