[CMake] Running tests on remote machine

Eric Noulard eric.noulard at gmail.com
Tue Mar 19 17:10:56 EDT 2013


2013/3/19 Stefan Reuschl <stefan.reuschl at gmail.com>:
> If you don't already have a wrapper for add_test(), you can just overwrite
> the add_test() function once without having to change every call to
> add_test(), e.g.:
>
> function(add_test name cmd)
>   _add_test(name ${CMAKE_COMMAND} -P testDriver.cmake -DCOMMAND=${cmd})
> endfunction()
>
> The test driver script can start the remote debugger. That approach worked
> fine for me (I'm only using ssh). The tricky part with that approach was to
> upload/download input/output data files for the test binary.

AFAIK this is not needed for Robert because the VM has the executable
and data files on a network drive.

The only issue may be to translate drive name/prefix if they are different
on the host or on the VM.

>
>
> 2013/3/19 David Cole <dlrdave at aol.com>
>>
>> Can you run ctest on your development machine, but have each test invoke
>> the remote debugger separately? i.e. -- write a wrapper around add_test
>> which invokes the command via the remote debugger on the VM instead of
>> locally...
>>
>> That might be painful to do if you have lots of tests, and you don’t
>> already have an add_test wrapper. But if you do have a wrapper, it should be
>> easy enough in theory. (Assuming you can drive a remote debugger session via
>> a command line of some sort. Or via a script.)
>>
>>
>> From: Robert Dailey
>> Sent: March 19, 2013 3:33 PM
>> To: Eric Noulard
>> CC: CMake
>> Subject: Re: [CMake] Running tests on remote machine
>>
>> It simply uses TCP connection to the remote machine, using the Windows
>> Remote Debugger service. it handles the details of remote debugging,
>> all I do is point it to the correct executable to run from my project
>> settings on the host machine. No authe
>>
>> The only thing that the program needs on the VM is the runtime
>> libraries, which are available as a separate installer
>> (redistributable package). Basically my VM simulates a production
>> environment for the most part, where if you had installed the program
>> via installer on that machine, it would run in a similar fashion.
>>
>> Looks like I'm stuck making my VM into a dev machine so I can build
>> the code from scratch & run tests :( ... unless anyone has some ideas.
>>
>> On Mon, Mar 18, 2013 at 1:39 PM, Eric Noulard <eric.noulard at gmail.com>
>> wrote:
>> > 2013/3/18 Robert Dailey <rcdailey.lists at gmail.com>:
>> >> Hi,
>> >>
>> >> I currently have a VM that I use to debug my executables. It has the
>> >> environment setup that is needed by the programs. Naturally, the tests
>> >> also depend on this environment (nothing was really mocked).
>> >>
>> >> The machine hosting the VM is my dev machine, it only has CMake &
>> >> Visual Studio. I set it up to remote debug on the VM, which accesses
>> >> the compiled binaries via network shared folder.
>> >
>> > Does remote debug with Visual enables the host to "run" something on the
>> > remote target without having some part of Visual installed on the
>> > remote target  ?
>> >
>> >> Is there a way I can just run the tests on the VM with CTest? I don't
>> >> want to have to install Perforce, Visual Studio, and CMake on my VM if
>> >> I can avoid it. Note both machines are running Windows.
>> >
>> > AIFAIK CTest has no 'remote run' capability, so you'll need at least
>> > to have CTest
>> > installed on the VM.
>> >
>> > That said I do have a not so different usage.
>> > I need to to distributed testing on a CMake enabled project.
>> > What I currently do is to write a (python)
>> > "test driver script" which does one (or several) remote connection to
>> > the target(s)
>> > and launch the CMake built binaries (and possibly tests inputs) which
>> > are available
>> > through network drive (host mounted on the target(s)).
>> >
>> > That way CTest runs on my host and the executable runs on the remote
>> > targets.
>> > The drawback is that I need to have a relatively "intelligent" scripts
>> > which is able
>> > to remote login and monitor/connect to  stderr, stdin, stdout on the
>> > remote execution.
>> >
>> > My solution currently only works on Unixes or on a remote host which has
>> > an SSH server (ssh is my "generic" remote logion solution).
>> >
>> > Thus my question, how does Visual do the remote login/connection for
>> > debugging?
>> >
>> > --
>> > Erk
>> > Le gouvernement représentatif n'est pas la démocratie --
>> > http://www.le-message.org
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>
>



-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list