X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tests%2Ftools%2FtoolTestRunner.cxx;h=212321106ec1a32458977c592be1e19a4274a8a6;hb=f4eb79e1b67e9c592a1deba19aa94af365bf2df9;hp=768afecc200b7241d63b92ab6d0ab3419a504cf6;hpb=8b7357d079eaecb4cbbc3c0cf8f104aa4dce9b0a;p=clitk.git diff --git a/tests/tools/toolTestRunner.cxx b/tests/tools/toolTestRunner.cxx index 768afec..2123211 100644 --- a/tests/tools/toolTestRunner.cxx +++ b/tests/tools/toolTestRunner.cxx @@ -33,32 +33,103 @@ int getOutputOptionIndex(int argc, char** argv){ } return NO_OUTPUT_OPTION; } + std::string getTmpFileName(){ +#ifdef _WIN32 + char fileName[L_tmpnam_s]; + errno_t err = tmpnam_s(fileName); +#else char fileName[] = "/tmp/vvTempXXXXXX"; + int err=0; int fd = mkstemp(fileName); - if(fd==-1){ + if(fd==-1) err=1; +#endif + if(err){ std::cout<<"couldnot create file. Exiting"<"<"<