summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2006-07-21 14:26:05 (GMT)
committerKen Martin <ken.martin@kitware.com>2006-07-21 14:26:05 (GMT)
commit0189ce3424e15aaa82e61c7f05875062b8d25ca1 (patch)
tree0306464a01a008b4393d6849625cb4ec116ccb0e /Tests
parent8a357d9c8afc2bcc5d565eb935a2463252e77881 (diff)
downloadCMake-0189ce3424e15aaa82e61c7f05875062b8d25ca1.zip
CMake-0189ce3424e15aaa82e61c7f05875062b8d25ca1.tar.gz
CMake-0189ce3424e15aaa82e61c7f05875062b8d25ca1.tar.bz2
ENH: increase coverage in a couple places
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CTestTest/test.cmake.in1
-rw-r--r--Tests/LoadCommand/CMakeCommands/cmTestCommand.c34
-rw-r--r--Tests/LoadCommand/CMakeLists.txt6
-rw-r--r--Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c34
-rw-r--r--Tests/LoadCommandOneConfig/CMakeLists.txt6
5 files changed, 73 insertions, 8 deletions
diff --git a/Tests/CTestTest/test.cmake.in b/Tests/CTestTest/test.cmake.in
index ae7ea07..53de732 100644
--- a/Tests/CTestTest/test.cmake.in
+++ b/Tests/CTestTest/test.cmake.in
@@ -24,6 +24,7 @@ SET(CTEST_CMAKE_COMMAND "\"${CTEST_EXECUTABLE_PATH}/cmake\"")
MESSAGE("CTest executable: ${CTEST_EXECUTABLE_NAME}")
MESSAGE("CMake executable: ${CTEST_CMAKE_COMMAND}")
+CTEST_SLEEP(5)
####################################################################
# The values in this section are optional you can either
diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
index bd36b5c..c5ee611 100644
--- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
@@ -20,6 +20,9 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
char buffer[1024];
void *source_file;
char *args[2];
+ char *ccArgs[4];
+ char *ccDep[1];
+ char *ccOut[1];
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
cmVTKWrapTclData *cdata =
@@ -72,8 +75,6 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
info->CAPI->DisplaySatus(mf, str);
info->CAPI->Free(str);
- info->CAPI->Free(file);
-
info->CAPI->DisplaySatus(mf, info->CAPI->GetProjectName(mf));
info->CAPI->DisplaySatus(mf, info->CAPI->GetHomeDirectory(mf));
info->CAPI->DisplaySatus(mf, info->CAPI->GetHomeOutputDirectory(mf));
@@ -117,9 +118,36 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
info->CAPI->DestroySourceFile(source_file);
- srcs = "LoadedCommand.cxx";
+ srcs = argv[2];
info->CAPI->AddExecutable(mf,"LoadedCommand",1, &srcs, 0);
+ /* add customs commands to generate the source file */
+ ccArgs[0] = "-E";
+ ccArgs[1] = "copy";
+ ccArgs[2] = argv[0];
+ ccArgs[3] = argv[1];
+ ccDep[0] = ccArgs[2];
+ ccOut[0] = ccArgs[3];
+ info->CAPI->AddCustomCommand(mf, "LoadedCommand.cxx",
+ file,
+ 4, ccArgs,
+ 1, ccDep,
+ 1, ccOut,
+ "LoadedCommand");
+
+
+ ccArgs[2] = argv[1];
+ ccArgs[3] = argv[2];
+ ccDep[0] = ccArgs[2];
+ ccOut[0] = ccArgs[3];
+ info->CAPI->AddCustomCommandToOutput(mf, ccOut[0],
+ file,
+ 4, ccArgs,
+ ccDep[0],
+ 0, 0);
+
+ info->CAPI->Free(file);
+
args[0] = "TEST_EXEC";
args[1] = "TRUE";
diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt
index 411d439..23a52a8 100644
--- a/Tests/LoadCommand/CMakeLists.txt
+++ b/Tests/LoadCommand/CMakeLists.txt
@@ -51,7 +51,11 @@ IF (COMPILE_OK)
)
# if the command loaded, execute the command
IF (COMMAND CMAKE_TEST_COMMAND)
- CMAKE_TEST_COMMAND()
+ CMAKE_TEST_COMMAND(
+ "${LoadedCommand_SOURCE_DIR}/LoadedCommand.cxx"
+ "${LoadedCommand_BINARY_DIR}/LoadedCommand2.cxx"
+ "${LoadedCommand_BINARY_DIR}/LoadedCommand3.cxx"
+ )
ENDIF (COMMAND CMAKE_TEST_COMMAND)
ELSE (COMPILE_OK)
MESSAGE("failed to compile CMAKE_LOADED_COMMANDS")
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
index bd36b5c..c5ee611 100644
--- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
@@ -20,6 +20,9 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
char buffer[1024];
void *source_file;
char *args[2];
+ char *ccArgs[4];
+ char *ccDep[1];
+ char *ccOut[1];
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
cmVTKWrapTclData *cdata =
@@ -72,8 +75,6 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
info->CAPI->DisplaySatus(mf, str);
info->CAPI->Free(str);
- info->CAPI->Free(file);
-
info->CAPI->DisplaySatus(mf, info->CAPI->GetProjectName(mf));
info->CAPI->DisplaySatus(mf, info->CAPI->GetHomeDirectory(mf));
info->CAPI->DisplaySatus(mf, info->CAPI->GetHomeOutputDirectory(mf));
@@ -117,9 +118,36 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
info->CAPI->DestroySourceFile(source_file);
- srcs = "LoadedCommand.cxx";
+ srcs = argv[2];
info->CAPI->AddExecutable(mf,"LoadedCommand",1, &srcs, 0);
+ /* add customs commands to generate the source file */
+ ccArgs[0] = "-E";
+ ccArgs[1] = "copy";
+ ccArgs[2] = argv[0];
+ ccArgs[3] = argv[1];
+ ccDep[0] = ccArgs[2];
+ ccOut[0] = ccArgs[3];
+ info->CAPI->AddCustomCommand(mf, "LoadedCommand.cxx",
+ file,
+ 4, ccArgs,
+ 1, ccDep,
+ 1, ccOut,
+ "LoadedCommand");
+
+
+ ccArgs[2] = argv[1];
+ ccArgs[3] = argv[2];
+ ccDep[0] = ccArgs[2];
+ ccOut[0] = ccArgs[3];
+ info->CAPI->AddCustomCommandToOutput(mf, ccOut[0],
+ file,
+ 4, ccArgs,
+ ccDep[0],
+ 0, 0);
+
+ info->CAPI->Free(file);
+
args[0] = "TEST_EXEC";
args[1] = "TRUE";
diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt
index 411d439..23a52a8 100644
--- a/Tests/LoadCommandOneConfig/CMakeLists.txt
+++ b/Tests/LoadCommandOneConfig/CMakeLists.txt
@@ -51,7 +51,11 @@ IF (COMPILE_OK)
)
# if the command loaded, execute the command
IF (COMMAND CMAKE_TEST_COMMAND)
- CMAKE_TEST_COMMAND()
+ CMAKE_TEST_COMMAND(
+ "${LoadedCommand_SOURCE_DIR}/LoadedCommand.cxx"
+ "${LoadedCommand_BINARY_DIR}/LoadedCommand2.cxx"
+ "${LoadedCommand_BINARY_DIR}/LoadedCommand3.cxx"
+ )
ENDIF (COMMAND CMAKE_TEST_COMMAND)
ELSE (COMPILE_OK)
MESSAGE("failed to compile CMAKE_LOADED_COMMANDS")