2014-10-15 9:30 GMT+02:00 Domen Vrankar <[email protected]>:

> Hi,
>
> I was looking at CMake automated tests and did not quite understand how
> they are intended to be written.
>
> Do they only test for e.g. if CPack executes without errors or do they
> check generated files content (e.g. diff or call for e.g. rpm -qi
> some_pkg.rpm and then diff the output)? I'm not certain how in-depth the
> automated tests should be.
>

The current CPack test inside the CMake source tree are very simple they
only check whether if cpack runs properly in various situation
for various CPack generator. e.g. the "CPackComponentsForAll" test is run
for the available CPack generator on the current platform
and "counts" if the number of generated package file is the appropriate
one, see
<CMakeRootSource>/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake

The other tests CPackComponents and CPackTestAllGenerators only verifies
that cpack run and terminates OK.
The logic of activation of the various CPack generator is in:
<CMakeRootSource>/Tests/CMakeLists.txt

inside this file reads e.g.: if(CTEST_RUN_CPackComponentsForAll)  and the
following lines.

Doing more "semantic checks" e.g. running rpm -qi then compare to a
reference file etc... would be indeed very nice.
The thing is the combinatorial explosion of what you can generate for each
CPack generator is high but any more "semantic"
test for any CPack generator would be (I think) a good point.


> Is there a cmake developers wiki page or some other reference with
> guidelines on how to write automated tests for CMake and CPack?
>

I don't think there is anything like that, but that would be very helpful.


>
> Thanks,
> Domen
>
> --
>
> 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:
> http://public.kitware.com/mailman/listinfo/cmake-developers
>



-- 
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to