@@ -81,7 +81,7 @@ def test_modifyFlagsForNewArch_whenOnOldArch_doNothing
8181 assert_equal ( yoga_release_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited)" )
8282 end
8383
84- def test_modifyFlagsForNewArch_whenOnNewArch_updateFlags
84+ def test_modifyFlagsForNewArch_whenOnNewArchAndIsRelease_updateFlags
8585 # Arrange
8686 first_xcconfig = prepare_xcconfig ( "First" )
8787 second_xcconfig = prepare_xcconfig ( "Second" )
@@ -102,47 +102,17 @@ def test_modifyFlagsForNewArch_whenOnNewArch_updateFlags
102102
103103 # Assert
104104 assert_equal ( first_xcconfig . attributes [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1" )
105+ assert_nil ( first_xcconfig . attributes [ "OTHER_CFLAGS" ] )
105106 assert_equal ( first_xcconfig . save_as_invocation , [ "a/path/First.xcconfig" ] )
106107 assert_equal ( second_xcconfig . attributes [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1" )
108+ assert_nil ( second_xcconfig . attributes [ "OTHER_CFLAGS" ] )
107109 assert_equal ( second_xcconfig . save_as_invocation , [ "a/path/Second.xcconfig" ] )
108110 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" )
109- 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" )
110- assert_equal ( yoga_debug_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited)" )
111- assert_equal ( yoga_release_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited)" )
112- end
113-
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" )
111+ assert_nil ( react_core_debug_config . build_settings [ "OTHER_CFLAGS" ] )
142112 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" )
143113 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" )
114+ assert_equal ( yoga_debug_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited)" )
115+ assert_nil ( yoga_debug_config . build_settings [ "OTHER_CFLAGS" ] )
146116 assert_equal ( yoga_release_config . build_settings [ "OTHER_CPLUSPLUSFLAGS" ] , "$(inherited) -DNDEBUG" )
147117 assert_equal ( yoga_release_config . build_settings [ "OTHER_CFLAGS" ] , "$(inherited) -DNDEBUG" )
148118 end
0 commit comments