diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-22 17:00:00 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-22 17:00:00 -0400 |
commit | 040f7768859ae974d10ef24670768fce574bb2e4 (patch) | |
tree | 42b9e48b578e01521bfe3266e26616fa555bfffd /Tests/Complex | |
parent | 43bc8a0d63705d57481ec7c9cefed1b65402e98f (diff) | |
download | cmake-040f7768859ae974d10ef24670768fce574bb2e4.tar.gz |
FIX: fix the problem where a target is a single character and nmake gets confused and add a test for it
Diffstat (limited to 'Tests/Complex')
-rw-r--r-- | Tests/Complex/Executable/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/Complex/Executable/complex.cxx | 28 |
2 files changed, 29 insertions, 1 deletions
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 26626a6f78..093ba916b7 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -11,7 +11,7 @@ LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source/kwsys) SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) LINK_LIBRARIES(${COMPLEX_LIBS}) - +ADD_EXECUTABLE(A A.cxx) ADD_EXECUTABLE(complex complex) ADD_EXECUTABLE(complex.file complex.file.cxx) IF (UNIX) diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index adf99d7c3d..441a2910d3 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -111,7 +111,35 @@ int main() lib += CMAKE_INTDIR; lib += "/"; #endif + std::string exe = lib; + // Test a single character executable to test a: in makefiles + exe += "A"; + exe += cmSystemTools::GetExecutableExtension(); + int ret; + std::string errorMessage; + if(cmSystemTools::RunSingleCommand(exe.c_str(), 0, &ret)) + { + if(ret != 10) + { + errorMessage += exe; + errorMessage += " did not return 10"; + } + } + else + { + errorMessage += exe; + errorMessage += ": failed to run."; + } + if(errorMessage.size()) + { + cmFailed(errorMessage.c_str()); + } + else + { + cmPassed("run Single Character executable A returned 10 as expected."); + } + lib += cmDynamicLoader::LibPrefix(); lib += "CMakeTestModule"; lib += cmDynamicLoader::LibExtension(); |