[CMake] CTest and X server while logged out on linux

Tom Vercauteren tom.vercauteren at m4x.org
Wed Mar 24 14:05:14 EDT 2010


Hi all,

Apologies if my question seems a little off-topic for this mailing
list. I know it's rather a linux cron question but the use case seems
mostly useful in a dashboard setup to me. I have not found a decent
answer with google yet and thought that if someone knew how to solve
my problem, it would be beneficial  to add it to
  http://www.cmake.org/Wiki/CMake_Scripting_Of_CTest#On_Unix.2FMacOSX

Here is my scenario. I have a project that is built with cmake, tested
with ctest and the results are sent to cdash. The process runs every
night with a cron job and I am not in front of my computer at this
time. Some tests need a X server to complete even if they are fully
automated.

If I leave my session open during the night, everything is OK.
However, if I log out, the unit tests fail with the following error:
  "cannot connect to X server :0"

Would anyone know how to solve this problem and give the cron job
access to X even when I am not logged in?

My current crontab contains the following lines

DISPLAY=:0

30 1 * * 1,2,3,4,5      tom     /usr/bin/ctest -j4 -VV -S
some_full_path_ctest_option.cmake -O some_full_path_log.txt


My computer runs on kubuntu karmic if that's of any importance.



More information about the CMake mailing list