diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-07-24 19:40:52 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-07-24 19:40:52 (GMT) |
commit | 42819b7a5d99caa0d7415408358d99048ca234b0 (patch) | |
tree | 975208004ae08df42dbd6ccec6cc4d908cc3d273 /Tests/LoadCommand | |
parent | 3b743880503248235f319bd3e59e534ea26383f6 (diff) | |
download | CMake-42819b7a5d99caa0d7415408358d99048ca234b0.zip CMake-42819b7a5d99caa0d7415408358d99048ca234b0.tar.gz CMake-42819b7a5d99caa0d7415408358d99048ca234b0.tar.bz2 |
ENH: add more coverage
Diffstat (limited to 'Tests/LoadCommand')
-rw-r--r-- | Tests/LoadCommand/CMakeCommands/cmTestCommand.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c index b1431cf..081c288 100644 --- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c +++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c @@ -121,6 +121,9 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) srcs = argv[2]; info->CAPI->AddExecutable(mf,"LoadedCommand",1, &srcs, 0); + // remove an old file if it is there + info->CAPI->RemoveFile(argv[2]); + /* add customs commands to generate the source file */ ccArgs[0] = "-E"; ccArgs[1] = "copy"; @@ -146,6 +149,14 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) ccDep[0], 0, 0); + + ccArgs[1] = "echo"; + ccArgs[2] = "Build has finished"; + info->CAPI->AddCustomCommandToTarget(mf, "LoadedCommand", + file, + 3, ccArgs, + CM_POST_BUILD); + info->CAPI->Free(file); args[0] = "TEST_EXEC"; @@ -158,6 +169,13 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) } info->CAPI->ExecuteCommand(mf,"SET",2,args); + // make sure we can find the source file + if (!info->CAPI->GetSource(mf,argv[1])) + { + info->CAPI->SetError(mf, "Source file could not be found!"); + return 0; + } + return 1; } |