[CMake] Multiple tests in a single file

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Fri Jan 6 17:54:50 EST 2012


Hi David,

Not too long ago I was browsing the project of a friend who worked on BTK
(The toolkit used by Mokka, a motion kinematic & kinetic analyser) [1].

I noticed that he is using *cxxtest* [2] along with *ctest*. It seems it
could to address the use case you are describing.

See Example integration [3] and cxxtest source [4]

Hth
Jc

[1] https://b-tk.googlecode.com/svn/web/mokka/index.html
[2] http://cxxtest.tigris.org/
[3]
https://code.google.com/p/b-tk/source/browse/BTK/trunk/Testing/Code/C3DFileReaderTest.h
[4]
https://code.google.com/p/b-tk/source/browse/#svn%2FBTK%2Ftrunk%2FUtilities%2FCxxTest%2Fcxxtest

On Fri, Jan 6, 2012 at 10:03 AM, David Doria <daviddoria at gmail.com> wrote:

> Does CTest have a mechanism to run man mini-tests in a single file?
> I'm looking for something equivalent to the UnitTest++ syntax:
>
> TEST(YourTestName)
> {}
> TEST(YourOtherTestName){}
> int main(){  return UnitTest::RunAllTests();}
> Of course you could do something like:
>
> int YourTestName()
> {
>
> }
>
> int YourOtherTestName()
> {
> }
>
> int main()
> {
>   YourTestName();
>  YourOtherTestName();
> }
>
> but then you have to manually output the name of the test if it fails,
> you could forget to call one of the tests, etc.
>
> Is there anything like this for CMake/CTest?
>
> Thanks,
>
> David
> --
>
> 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
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120106/3fdba269/attachment.htm>


More information about the CMake mailing list