[CMake] ctest: how to skip tests?

Dave Milter davemilter at gmail.com
Wed Jul 2 11:05:45 EDT 2008


On 7/2/08, Andreas Schneider <mail at cynapses.org> wrote:
> Dave Milter wrote:
>
> > I have project with usage of cmake and ctest.
> >
> > Now I need to add tests, that may have sense or not have sense to run
> > on certain machine.
> >
> > For example, if we have installed MySql and libmysql there is sense to
> > test part of code working with mysql, but no sense to check parts that
> > working with
> > postgresql or oracle, if there are no such software on machine.
> >
> > But all code that work with different databases are part of our product,
> > so we need to warn that some part of test suite is not running.
> >
> >
>
>  Normally you create a "CTestCustom.cmake" file.
>
>  if (NOT ${MYSQL_FOUND})
>  set(CTEST_CUSTOM_TESTS_IGNORE
>   ${CTEST_CUSTOM_TESTS_IGNORE}
>   test1
>   test2
>  )
>  endif (NOT ${MYSQL_FOUND)
>

And ctest print at the end N passed, M failed,
K ignored?

But I need something litle different, sorry for bad example.
There are things like permissions of test user to database,
maximum allowed size of table and so on and things may change
after configure.

I want during tests collection runing
skip some tests. Because  of all knowledge about may have sense to
run or not concetrate in test, so logicaly decision skip or not skip
also m


More information about the CMake mailing list