Re: [CMake] ctest: how to skip tests?

2008-07-02 Thread Andreas Schneider

Dave Milter wrote:

Hi.

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)

...

http://www.cmake.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest


-- andreas

--
http://www.cynapses.org/ - cybernetic synapses




signature.asc
Description: OpenPGP digital signature
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] ctest: how to skip tests?

2008-07-02 Thread Dave Milter
On 7/2/08, Andreas Schneider <[EMAIL PROTECTED]> 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
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake