cross-testing support in cmake

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

cross-testing support in cmake

Stefan Seefeld

Hello,

I'm looking for ways to enable cross-testing with cmake. I imagine some helper script that, during test execution, copies the test binary to a test platform, runs the binary there, and reports back the test result. Does cmake have support for such a scenario ?

Thanks,


Stefan
-- 

      ...ich hab' noch einen Koffer in Berlin...

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cross-testing support in cmake

Miller Henry

Easy enough.  ADD_TEST can run whatever you want.

 

I created a simple cmake function

Function(RUN_REMOTE_TEST testname, other_args)

   # insert useful code here…

   add_test(${testname}

      remote_run_test ${binary_dir}/${testname} other test runner script args…

  )

End_function()

 

You will have to figure out how to make the above work for your needs, but the idea is simple enough.   One useful thing I do in our function is create a custom target to run the test as part of the build as well, that way the TDD cycle runs all the tests. 

 

From: CMake <[hidden email]> On Behalf Of Stefan Seefeld
Sent: Tuesday, November 5, 2019 8:06 PM
To: CMake <[hidden email]>
Subject: [CMake] cross-testing support in cmake

 

Hello,

I'm looking for ways to enable cross-testing with cmake. I imagine some helper script that, during test execution, copies the test binary to a test platform, runs the binary there, and reports back the test result. Does cmake have support for such a scenario ?

Thanks,

 

Stefan
-- 
 
      ...ich hab' noch einen Koffer in Berlin...

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cross-testing support in cmake

Andrew Fuller-2
In reply to this post by Stefan Seefeld

From: CMake <[hidden email]> on behalf of Stefan Seefeld <[hidden email]>
Sent: November 5, 2019 6:06 PM
To: CMake <[hidden email]>
Subject: [CMake] cross-testing support in cmake
 

Hello,

I'm looking for ways to enable cross-testing with cmake. I imagine some helper script that, during test execution, copies the test binary to a test platform, runs the binary there, and reports back the test result. Does cmake have support for such a scenario ?

Thanks,


Stefan
-- 

      ...ich hab' noch einen Koffer in Berlin...

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cross-testing support in cmake

Stefan Seefeld


On 2019-11-06 11:00 a.m., Andrew Fuller wrote:


Yes, that's *exactly* what I was looking for; thanks ! (I'm actually using `gtest_add_tests()`, but assuming that this internally calls `add_test()`, I assume the injection will still happen.


Many thanks !


Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cross-testing support in cmake

Stefan Seefeld
In reply to this post by Andrew Fuller-2


On 2019-11-06 11:00 a.m., Andrew Fuller wrote:


So it looks like this variable indeed allows me to define a test wrapper script that handles the uploading and remote execution.

There is, however, a minor complication: Most of my test executables require some data files that I need to upload, too.

How can I inform my wrapper script about those ?

Is there some trick involving target properties and generator expressions that I could use such that the invocation of the wrapper script will receive some target-specific arguments ?


Thanks,



Stefan
--

      ...ich hab' noch einen Koffer in Berlin...
    

--

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org