diff options
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 26626a6..093ba91 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 adf99d7..441a291 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(); |