@@ -111,6 +111,42 @@ def test_modifyFlagsForNewArch_whenOnNewArch_updateFlags
111111 assert_equal ( yoga_release_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited)" )
112112 end
113113
114+ def test_modifyFlagsForNewArch_whenOnNewArchAndIsRelease_updateFlags
115+ # Arrange
116+ first_xcconfig = prepare_xcconfig ( "First" )
117+ second_xcconfig = prepare_xcconfig ( "Second" )
118+ react_core_debug_config = prepare_CXX_Flags_build_configuration ( "Debug" )
119+ react_core_release_config = prepare_CXX_Flags_build_configuration ( "Release" )
120+ yoga_debug_config = prepare_CXX_Flags_build_configuration ( "Debug" )
121+ yoga_release_config = prepare_CXX_Flags_build_configuration ( "Release" )
122+
123+ installer = prepare_installer_for_cpp_flags (
124+ [ first_xcconfig , second_xcconfig ] ,
125+ {
126+ "React-Core" => [ react_core_debug_config , react_core_release_config ] ,
127+ "Yoga" => [ yoga_debug_config , yoga_release_config ] ,
128+ }
129+ )
130+ # Act
131+ NewArchitectureHelper . modify_flags_for_new_architecture ( installer , true , is_release : true )
132+
133+ # Assert
134+ assert_equal ( first_xcconfig . attributes [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DNDEBUG" )
135+ assert_equal ( first_xcconfig . attributes [ "OTHER_CFLAGS" ] , "$(inherited) -DNDEBUG" )
136+ assert_equal ( first_xcconfig . save_as_invocation , [ "a/path/First.xcconfig" ] )
137+ assert_equal ( second_xcconfig . attributes [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DNDEBUG" )
138+ assert_equal ( second_xcconfig . attributes [ "OTHER_CFLAGS" ] , "$(inherited) -DNDEBUG" )
139+ assert_equal ( second_xcconfig . save_as_invocation , [ "a/path/Second.xcconfig" ] )
140+ assert_equal ( react_core_debug_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DNDEBUG" )
141+ assert_equal ( react_core_debug_config . build_settings [ "OTHER_CFLAGS" ] , "$(inherited) -DNDEBUG" )
142+ assert_equal ( react_core_release_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DNDEBUG" )
143+ assert_equal ( react_core_release_config . build_settings [ "OTHER_CFLAGS" ] , "$(inherited) -DNDEBUG" )
144+ assert_equal ( yoga_debug_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DNDEBUG" )
145+ assert_equal ( yoga_debug_config . build_settings [ "OTHER_CFLAGS" ] , "$(inherited) -DNDEBUG" )
146+ assert_equal ( yoga_release_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DNDEBUG" )
147+ assert_equal ( yoga_release_config . build_settings [ "OTHER_CFLAGS" ] , "$(inherited) -DNDEBUG" )
148+ end
149+
114150 # =================================== #
115151 # Test - install Modules Dependencies #
116152 # =================================== #
0 commit comments