[CMake] About testing with ctest

Slava Semushin php-coder at ngs.ru
Tue Sep 19 04:03:28 EDT 2006


    Hello all!

    I tried using ctect and have some questions.

    - I added ENABLE_TESTING() to CMakeLists.txt and ADD_TEST() to
      tests/CMakeLists.txt and my test works. But I see autogenerated
      files with name DartTestfile.txt in src/ also:

      [slava at semushin ~/openfm]$ cat src/DartTestfile.txt
      # CMake generated Testfile for 
      # Source directory: /home/slava/openfm/src
      # Build directory: /home/slava/openfm/src
      # 
      # This file replicates the SUBDIRS() and ADD_TEST() commands from the
      # source
      # tree CMakeLists.txt file, skipping any SUBDIRS() or ADD_TEST() commands
      # that are excluded by CMake control structures, i.e. IF() commands.
      #
      # The next line is critical for Dart to work
      # Duh :-)

      [slava at semushin ~/openfm]$

      So, is it possible do not create file-tempalate DartTestfile.txt
      when not SUBDIRS() or ADD_TEST() specified for that directory?

    - Why I can't set name with spaces for test? For example:

      ADD_TEST ("print help"  run_tests.sh 1)

      instead of

      ADD_TEST ("print_help"  run_tests.sh 1)

      Now I have error for first case:

        2/  2 Testing print                         Unable to find
        executable: help

        50% tests passed, 1 tests failed out of 2

        The following tests FAILED:
                  2 - print (Not Run)
      Errors while running CTest
      make: *** [test] Error 8

    - And also why when I run make test VERBOSE=1 ctest works in nornal
      mode? I expect then ctest should runs with -V flags, for example.


   Thanks in advance.


-- 
+ Slava Semushin | php-coder @ ngs.ru
+ ALT Linux Team | php-coder @ altlinux.ru



More information about the CMake mailing list