diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-01-15 22:31:22 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-01-15 22:31:22 (GMT) |
commit | c6d2312619f008a691d9a313988b15c02e4f94cd (patch) | |
tree | 3dfde773b647d2739f97f0217dd1a40225f1c0ff /Source | |
parent | 17d8775e82aafe373f25b6d6ce9a568ab78816f2 (diff) | |
download | CMake-c6d2312619f008a691d9a313988b15c02e4f94cd.zip CMake-c6d2312619f008a691d9a313988b15c02e4f94cd.tar.gz CMake-c6d2312619f008a691d9a313988b15c02e4f94cd.tar.bz2 |
ENH: add testing for modules and one two config modes for cmaketest
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Source/cmaketest.cxx | 32 |
2 files changed, 34 insertions, 9 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 19a3a6b..830c087 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -156,12 +156,23 @@ IF(BUILD_TESTING) ${CMake_BINARY_DIR}/Tests/LoadCommand LoadedCommand) + ADD_TEST(LoadedCommandOneConfig ${CMake_BINARY_DIR}/Source/cmaketest + ${CMake_SOURCE_DIR}/Tests/LoadCommand + ${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig + LoadedCommand ONLY_ONE_CONFIG) + ADD_TEST(complex ${CMake_BINARY_DIR}/Source/cmaketest ${CMake_SOURCE_DIR}/Tests/Complex ${CMake_BINARY_DIR}/Tests/Complex complex ${CMake_BINARY_DIR}/Tests/Complex/bin) + ADD_TEST(complexOneConfig ${CMake_BINARY_DIR}/Source/cmaketest + ${CMake_SOURCE_DIR}/Tests/Complex + ${CMake_BINARY_DIR}/Tests/ComplexOneConfig + complex + ${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin ONLY_ONE_CONFIG) + ADD_TEST(Example ${CMake_BINARY_DIR}/Source/cmaketest ${CMake_SOURCE_DIR}/Example ${CMake_BINARY_DIR}/Example diff --git a/Source/cmaketest.cxx b/Source/cmaketest.cxx index efb312e..515e978 100644 --- a/Source/cmaketest.cxx +++ b/Source/cmaketest.cxx @@ -49,7 +49,16 @@ int do_cmaketest (int argc, char **argv) << "\t CMAKE_ARGS argument ...\n"; return 1; } - + bool onlyOneConfig = false; + if(argc > 3) + { + if(strcmp(argv[argc-1], "ONLY_ONE_CONFIG") == 0) + { + onlyOneConfig = true; + argc--; + } + } + // does the directory exist ? if (!cmSystemTools::FileIsDirectory(argv[2])) { @@ -138,16 +147,21 @@ int do_cmaketest (int argc, char **argv) return 1; } std::cout << "Done Generating build files.\n"; - - std::cout << "Generating build files (again)...\n"; - if (cm.Run(args) != 0) + // if the option ONLY_ONE_CONFIG is passed to the program + // only run the config step once + if(!onlyOneConfig) { - std::cerr << "Error: cmake execution failed\n"; - // return to the original directory - cmSystemTools::ChangeDirectory(cwd.c_str()); - return 1; + std::cout << "Generating build files (again)...\n"; + if (cm.Run(args) != 0) + { + std::cerr << "Error: cmake execution failed\n"; + // return to the original directory + cmSystemTools::ChangeDirectory(cwd.c_str()); + return 1; + } + std::cout << "Done Generating build files (again).\n"; } - std::cout << "Done Generating build files (again).\n"; + cmListFileCache::GetInstance()->ClearCache(); |