@ -370,6 +370,7 @@ endfunction()
# ! l y _ a d d _ g o o g l e t e s t : A d d s a n e w R U N _ T E S T u s i n g f o r t h e s p e c i f i e d t a r g e t u s i n g t h e s u p p l i e d c o m m a n d o r f a l l b a c k t o r u n n i n g
# g o o g l e t e s t t e s t s t h r o u g h A z T e s t R u n n e r
# \ a r g : N A M E N a m e t o f o r t h e t e s t r u n t a r g e t
# \ a r g : T A R G E T N a m e o f t h e t a r g e t m o d u l e t h a t i s b e i n g r u n f o r t e s t s . I f n o t p r o v i d e d , w i l l d e f a u l t t o ' N A M E '
# \ a r g : TEST_REQUIRES ( optional ) L i s t o f s y s t e m r e s o u r c e s t h a t a r e r e q u i r e d t o r u n t h i s t e s t .
# O n l y a v a i l a b l e o p t i o n i s " g p u "
# \ a r g : TEST_SUITE ( optional ) - " s m o k e " o r " p e r i o d i c " o r " s a n d b o x " - p r e v e n t s t h e t e s t f r o m r u n n i n g n o r m a l l y
@ -384,14 +385,20 @@ function(ly_add_googletest)
message ( FATAL_ERROR "Platform does not support test targets" )
endif ( )
set ( one_value_args NAME T EST_SUITE)
set ( one_value_args NAME T ARGET T EST_SUITE)
set ( multi_value_args TEST_COMMAND COMPONENT )
cmake_parse_arguments ( ly_add_googletest "${options}" "${one_value_args}" "${multi_value_args}" ${ ARGN } )
if ( ly_add_googletest_TARGET )
set ( target_name ${ ly_add_googletest_TARGET } )
else ( )
set ( target_name ${ ly_add_googletest_NAME } )
endif ( )
# A z T e s t R u n n e r m o d u l e s o n l y s u p p o r t s g o o g l e t e s t l i b r a r i e s , r e g a r d l e s s o f w h e t h e r o r n o t
# g o o g l e t e s t s u i t e s a r e s u p p o r t e d
set_property ( GLOBAL APPEND PROPERTY LY_AZTESTRUNNER_TEST_MODULES "${ly_add_googletest_NAME}" )
set_property ( GLOBAL APPEND PROPERTY LY_AZTESTRUNNER_TEST_MODULES "${ target_name }")
if ( NOT PAL_TRAIT_TEST_GOOGLE_TEST_SUPPORTED )
return ( )
@ -400,7 +407,7 @@ function(ly_add_googletest)
if ( ly_add_googletest_TEST_SUITE AND NOT ly_add_googletest_TEST_SUITE STREQUAL "main" )
# i f a s u i t e i s s p e c i f i e d , w e f i l t e r t o o n l y a c c e p t t h i n g s w h i c h m a t c h t h a t suite ( in c++ )
set ( non_ide_params "- gtest_filter=*SUITE_${ly_add_googletest_TEST_SUITE}*")
set ( non_ide_params "- - gtest_filter=*SUITE_${ly_add_googletest_TEST_SUITE}*")
else ( )
# o t h e r w i s e , i f i t s t h e m a i n s u i t e w e o n l y r u n s t h i n g s t h a t d o n t h a v e a n y o f t h e o t h e r s u i t e s .
# N o t e : i t d o e s n ' t d o A N D , o n l y ' o r ' - s o s p e c i f y i n g S U I T E _ m a i n : R E Q U I R E S _ g p u
@ -412,11 +419,11 @@ function(ly_add_googletest)
if ( NOT ly_add_googletest_TEST_COMMAND )
# U s e t h e N A M E p a r a m e t e r a s t h e b u i l d t a r g e t
set ( build_target ${ ly_add_googletest_NAME } )
set ( build_target ${ target_name } )
ly_strip_target_namespace ( TARGET ${ build_target } OUTPUT_VARIABLE build_target )
if ( NOT TARGET ${ build_target } )
message ( FATAL_ERROR "A valid build target \" ${ build_target } \" for test run \"${ ly_add_googletest_NAME }\" has not been found.\
message ( FATAL_ERROR "A valid build target \" ${ build_target } \" for test run \"${ target_name }\" has not been found.\
A v a l i d t a r g e t v i a t h e T A R G E T p a r a m e t e r o r a c u s t o m T E S T _ C O M M A N D m u s t b e s u p p l i e d " )
endif ( )