Re: [cmake-developers] [PATCH 2/2] Add test for generater expressions in test properties

2015-03-09 Thread Brad King
On 03/07/2015 04:26 PM, Gregor Jasny wrote:
> On 07/03/15 22:20, Gregor Jasny wrote:
>> Surprisingly "new-style" tests support generator expressions
>> also within all test properties. Add a test for that.

As Ben pointed out there is already a test for it:

 
http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/GeneratorExpression/CMakeLists.txt;hb=v3.2.0-rc2#l228

Even though there is some documentation it is not covered in enough
places as you point out.

> This still lacks documentation. The question is what would be the proper
> place(s) for this.
> 
> I'd add extend the genex note here:
> http://www.cmake.org/cmake/help/git-next/command/add_test.html?highlight=add_test
> 
> But I also think all test properties should receive an individual note.
> What do you think?

I don't think the individual properties need it because the support
is not specific to them.  The set_tests_properties command documentation
already mentions it, though it could be cleaned up with proper reST
markup so it is indexed and has a link.  The set_property documentation
should be extended to mention it for the TEST mode.

> If the "old-style" add_test lacks functionality how about deprecating it?

The old style test signature is likely used far too widely to deprecate.
One could extend the implementation of the old signature to warn if it
sees something that looks like a genex.

Thanks,
-Brad

-- 

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


Re: [cmake-developers] [PATCH 2/2] Add test for generater expressions in test properties

2015-03-09 Thread Ben Boeckel
On Sat, Mar 07, 2015 at 22:20:26 +0100, Gregor Jasny wrote:
> Suprisingly "new-style" tests support generater expressions
> also within all test properties. Add a test for that.

This patch isn't necessary. The docs mention that here:

http://www.cmake.org/cmake/help/v3.0/command/add_test.html

and here:

http://www.cmake.org/cmake/help/v3.0/command/set_tests_properties.html

> Generator expressions will be expanded the same as supported by the
> test’s add_test call.

Tests for both are here:


https://github.com/Kitware/CMake/blob/master/Tests/GeneratorExpression/CMakeLists.txt

--Ben
-- 

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

Re: [cmake-developers] [PATCH 2/2] Add test for generater expressions in test properties

2015-03-07 Thread Gregor Jasny
On 07/03/15 22:20, Gregor Jasny wrote:
> Surprisingly "new-style" tests support generator expressions
> also within all test properties. Add a test for that.

This still lacks documentation. The question is what would be the proper
place(s) for this.

I'd add extend the genex note here:
http://www.cmake.org/cmake/help/git-next/command/add_test.html?highlight=add_test

But I also think all test properties should receive an individual note.
What do you think?

If the "old-style" add_test lacks functionality how about deprecating it?

Thanks,
Gregor
-- 

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


[cmake-developers] [PATCH 2/2] Add test for generater expressions in test properties

2015-03-07 Thread Gregor Jasny
Suprisingly "new-style" tests support generater expressions
also within all test properties. Add a test for that.

Signed-off-by: Gregor Jasny 
---
 Tests/Environment/CMakeLists.txt | 12 
 1 file changed, 12 insertions(+)

diff --git a/Tests/Environment/CMakeLists.txt b/Tests/Environment/CMakeLists.txt
index 2b18d24..13d 100644
--- a/Tests/Environment/CMakeLists.txt
+++ b/Tests/Environment/CMakeLists.txt
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6)
 project(EnvironmentProj)
 
 add_executable(Environment main.cxx)
+set_property(TARGET Environment PROPERTY FOO Bar)
 
 enable_testing()
 
@@ -24,3 +25,14 @@ set_tests_properties(Environment1 EchoEnvironment1 PROPERTIES
 set_tests_properties(Environment2 EchoEnvironment2 PROPERTIES
   FAIL_REGULAR_EXPRESSION "CMAKE_ENV.*Happy Thanksgiving"
 )
+
+# Test with generator expression
+# Note: this requires a "new-style" add_test signature
+#
+add_test(NAME Environment3 COMMAND Environment)
+add_test(NAME EchoEnvironment3 COMMAND ${CMAKE_COMMAND} -E environment)
+
+set_tests_properties(Environment3 EchoEnvironment3 PROPERTIES
+  ENVIRONMENT "CMAKE_ENVIRONMENT_TEST_VAR=$"
+  PASS_REGULAR_EXPRESSION "CMAKE_ENV.*Bar"
+)
-- 
2.3.0

-- 

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