Labels on tests defined on another subdirectory

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Labels on tests defined on another subdirectory

Raffi Enficiaud-2
Hi,

I just wanted to know if it is possible from a directory to add labels
on tests defined on a sub-directory (via add_subdirectory).

When I do a set_tests_properties on the tests that were retrieved with
get_directory_property, cmake says that the test is not found.

Maybe I am missing some syntax there? The following does not work:

get_directory_property(CURRENT_DIRECTORY_TESTS
                                  DIRECTORY ${my_dir}
                                  TESTS)

if(NOT "${CURRENT_DIRECTORY_TESTS}" STREQUAL "")
     set_tests_properties(${CURRENT_DIRECTORY_TESTS} PROPERTIES LABELS
"some-labels")
endif()


Thanks!
Raffi

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Labels on tests defined on another subdirectory

Marc CHEVRIER
directory property 'TESTS' returns the tests created in the current directory only.
The main reason to this limitation is the fact that tests created in different directories can have same name.


Le mer. 19 sept. 2018 à 02:22, Raffi Enficiaud <[hidden email]> a écrit :
Hi,

I just wanted to know if it is possible from a directory to add labels
on tests defined on a sub-directory (via add_subdirectory).

When I do a set_tests_properties on the tests that were retrieved with
get_directory_property, cmake says that the test is not found.

Maybe I am missing some syntax there? The following does not work:

get_directory_property(CURRENT_DIRECTORY_TESTS
                                  DIRECTORY ${my_dir}
                                  TESTS)

if(NOT "${CURRENT_DIRECTORY_TESTS}" STREQUAL "")
     set_tests_properties(${CURRENT_DIRECTORY_TESTS} PROPERTIES LABELS
"some-labels")
endif()


Thanks!
Raffi

--

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:
https://cmake.org/mailman/listinfo/cmake

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Labels on tests defined on another subdirectory

Raffi Enficiaud-2
On 19.09.18 08:25, Marc CHEVRIER wrote:
> directory property 'TESTS' returns the tests created in the
> *current* directory only.
> The main reason to this limitation is the fact that tests created in
> different directories can have same name.

The get_directory_property call is made from the directory that is
calling add_subdirectory, so I am guessing that the property is
available everywhere?

I would like to modify the labels of some specific tests. Is there a
non-intrusive way to do that? Can I set a variable to inherit this LABEL
before the call to add_subdirectory?

Thanks!
Raffi

>
>
> Le mer. 19 sept. 2018 à 02:22, Raffi Enficiaud
> <[hidden email]
> <mailto:[hidden email]>> a écrit :
>
>     Hi,
>
>     I just wanted to know if it is possible from a directory to add labels
>     on tests defined on a sub-directory (via add_subdirectory).
>
>     When I do a set_tests_properties on the tests that were retrieved with
>     get_directory_property, cmake says that the test is not found.
>
>     Maybe I am missing some syntax there? The following does not work:
>
>     get_directory_property(CURRENT_DIRECTORY_TESTS
>                                        DIRECTORY ${my_dir}
>                                        TESTS)
>
>     if(NOT "${CURRENT_DIRECTORY_TESTS}" STREQUAL "")
>           set_tests_properties(${CURRENT_DIRECTORY_TESTS} PROPERTIES LABELS
>     "some-labels")
>     endif()
>
>
>     Thanks!
>     Raffi
>
>     --
>
>     Powered by www.kitware.com <http://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:
>     https://cmake.org/mailman/listinfo/cmake
>
>
>


--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Labels on tests defined on another subdirectory

Marc CHEVRIER
Using command 'get_directory_property(var DIRECTORY ${my_dir} TESTS)' is OK to retrieve tests defined in some sub directory.
But, it is useless because command 'set_test_properties()' must be called from the directory where the tests are defined.

but you can do:

set (MY_LABELS LABEL1)

add_subdirectory("my_dir")

and in "my_dir":

add_test(TEST1 ...)
set_property(TEST TEST1 APPEND PROPERTY LABELS ${MY_LABELS})


Le mer. 19 sept. 2018 à 19:45, Raffi Enficiaud <[hidden email]> a écrit :
On 19.09.18 08:25, Marc CHEVRIER wrote:
> directory property 'TESTS' returns the tests created in the
> *current* directory only.
> The main reason to this limitation is the fact that tests created in
> different directories can have same name.

The get_directory_property call is made from the directory that is
calling add_subdirectory, so I am guessing that the property is
available everywhere?

I would like to modify the labels of some specific tests. Is there a
non-intrusive way to do that? Can I set a variable to inherit this LABEL
before the call to add_subdirectory?

Thanks!
Raffi

>
>
> Le mer. 19 sept. 2018 à 02:22, Raffi Enficiaud
> <[hidden email]
> <mailto:[hidden email]>> a écrit :
>
>     Hi,
>
>     I just wanted to know if it is possible from a directory to add labels
>     on tests defined on a sub-directory (via add_subdirectory).
>
>     When I do a set_tests_properties on the tests that were retrieved with
>     get_directory_property, cmake says that the test is not found.
>
>     Maybe I am missing some syntax there? The following does not work:
>
>     get_directory_property(CURRENT_DIRECTORY_TESTS
>                                        DIRECTORY ${my_dir}
>                                        TESTS)
>
>     if(NOT "${CURRENT_DIRECTORY_TESTS}" STREQUAL "")
>           set_tests_properties(${CURRENT_DIRECTORY_TESTS} PROPERTIES LABELS
>     "some-labels")
>     endif()
>
>
>     Thanks!
>     Raffi
>
>     --
>
>     Powered by www.kitware.com <http://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:
>     https://cmake.org/mailman/listinfo/cmake
>
>
>


--

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:
https://cmake.org/mailman/listinfo/cmake

--

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:
https://cmake.org/mailman/listinfo/cmake