On 11/15/2014 03:34 AM, Rolf Eike Beer wrote: > Ruslan Baratov wrote: >> Done. Also I've found parse issue which is based on `sscanf` behaviour, >> e.g. string '123xyz' will be successfully parsed as a integer (%d). Same >> issue for example in file(STRINGS) command: > > I use strtol()/strtoul() for this kind of this, which also has a less > worrisome interface.
Yes, please change to that so a proper error can be produced for the new API when "123xyz" is given as a timeout, for example. The file(STRINGS) command could be fixed with a separate change. In order to be compatible it should do something like "%u%c" and produce a warning if %c matched anything. On 11/14/2014 06:27 PM, Ruslan Baratov wrote: > On linux you can test timeout by: > > cat script.cmake > file(LOCK "${CMAKE_CURRENT_LIST_DIR}/file-to-lock" TIMEOUT 5) > execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 10) > > cmake -P script.cmake & # start one instance in background > > cmake -P script.cmake # start second instance, expected lock failed > by timeout > CMake Error at script.cmake:1 (file): > file : error locking file > "/.../file-to-lock" (Timeout > reached). Please look at adding a case to the test suite for this. An outer process could take the lock and then execute_process a child that tries to take the lock with a timeout. Then check that it fails as expected. Thanks, -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers