summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLib/testRST.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-06 14:39:45 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-06 14:39:45 (GMT)
commit218699eb2827ca5f6082b1f9e1e84238cb301155 (patch)
tree5b17d887d42a6f1a69fd350d05885e003662cd2e /Tests/CMakeLib/testRST.cxx
parent618b7df5bf7767561822c1673a9640860a2613a1 (diff)
downloadCMake-218699eb2827ca5f6082b1f9e1e84238cb301155.zip
CMake-218699eb2827ca5f6082b1f9e1e84238cb301155.tar.gz
CMake-218699eb2827ca5f6082b1f9e1e84238cb301155.tar.bz2
Tests: Fix CMakeLib.testRST for relative __FILE__
Pass the test input directory as a runtime argument instead of depending on __FILE__ to locate it.
Diffstat (limited to 'Tests/CMakeLib/testRST.cxx')
-rw-r--r--Tests/CMakeLib/testRST.cxx9
1 files changed, 7 insertions, 2 deletions
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 = ".";