diff options
author | Brad King <brad.king@kitware.com> | 2014-06-09 14:28:42 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-06-09 14:28:42 (GMT) |
commit | 3c0652f8bf8974fde8b8313738272f2714b0f62b (patch) | |
tree | 9b4ff7f742133d562d895b92cf08ff05efb350dc | |
parent | 8c29d8d1e79ba5538368171bf89e8c55b5a58e54 (diff) | |
parent | 218699eb2827ca5f6082b1f9e1e84238cb301155 (diff) | |
download | CMake-3c0652f8bf8974fde8b8313738272f2714b0f62b.zip CMake-3c0652f8bf8974fde8b8313738272f2714b0f62b.tar.gz CMake-3c0652f8bf8974fde8b8313738272f2714b0f62b.tar.bz2 |
Merge topic 'testRST-no-preprocessor-FILE'
218699eb Tests: Fix CMakeLib.testRST for relative __FILE__
-rw-r--r-- | Tests/CMakeLib/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/CMakeLib/testRST.cxx | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 0e1fe8d..8c99f64 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -13,6 +13,8 @@ set(CMakeLib_TESTS testXMLSafe ) +set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR}) + if(WIN32) list(APPEND CMakeLib_TESTS testVisualStudioSlnParser @@ -39,7 +41,7 @@ if(CMAKE_OSX_ARCHITECTURES AND XCODE endif() foreach(test ${CMakeLib_TESTS}) - add_test(CMakeLib.${test} CMakeLibTests ${test}) + add_test(CMakeLib.${test} CMakeLibTests ${test} ${${test}_ARGS}) endforeach() if(TEST_CompileCommandOutput) diff --git a/Tests/CMakeLib/testRST.cxx b/Tests/CMakeLib/testRST.cxx index bad9560..37cb3fa 100644 --- a/Tests/CMakeLib/testRST.cxx +++ b/Tests/CMakeLib/testRST.cxx @@ -25,9 +25,14 @@ void reportLine(std::ostream& os, bool ret, std::string line, bool eol) } } -int testRST(int, char*[]) +int testRST(int argc, char* argv[]) { - std::string dir = cmSystemTools::GetFilenamePath(__FILE__); + if(argc != 2) + { + std::cerr << "Usage: testRST <dir>" << std::endl; + return 1; + } + std::string dir = argv[1]; if(dir.empty()) { dir = "."; |