@@ -474,6 +474,60 @@ def test_applyMacCatalystPatches_correctlyAppliesNecessaryPatches
474474 assert_equal ( user_project_mock . save_invocation_count , 1 )
475475 end
476476
477+ # ================================= #
478+ # Test - Apply Xcode 15 Patch #
479+ # ================================= #
480+
481+ def test_applyXcode15Patch_correctlyAppliesNecessaryPatch
482+ # Arrange
483+ first_target = prepare_target ( "FirstTarget" )
484+ second_target = prepare_target ( "SecondTarget" )
485+ third_target = TargetMock . new ( "ThirdTarget" , [
486+ BuildConfigurationMock . new ( "Debug" , {
487+ "GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) "SomeFlag=1" '
488+ } ) ,
489+ BuildConfigurationMock . new ( "Release" , {
490+ "GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) "SomeFlag=1" '
491+ } ) ,
492+ ] , nil )
493+
494+ user_project_mock = UserProjectMock . new ( "a/path" , [
495+ prepare_config ( "Debug" ) ,
496+ prepare_config ( "Release" ) ,
497+ ] ,
498+ :native_targets => [
499+ first_target ,
500+ second_target
501+ ]
502+ )
503+ pods_projects_mock = PodsProjectMock . new ( [ ] , { "hermes-engine" => { } } , :native_targets => [
504+ third_target
505+ ] )
506+ installer = InstallerMock . new ( pods_projects_mock , [
507+ AggregatedProjectMock . new ( user_project_mock )
508+ ] )
509+
510+ # Act
511+ ReactNativePodsUtils . apply_xcode_15_patch ( installer )
512+
513+ # Assert
514+ first_target . build_configurations . each do |config |
515+ assert_equal ( config . build_settings [ "GCC_PREPROCESSOR_DEFINITIONS" ] . strip ,
516+ '$(inherited) "_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"'
517+ )
518+ end
519+ second_target . build_configurations . each do |config |
520+ assert_equal ( config . build_settings [ "GCC_PREPROCESSOR_DEFINITIONS" ] . strip ,
521+ '$(inherited) "_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"'
522+ )
523+ end
524+ third_target . build_configurations . each do |config |
525+ assert_equal ( config . build_settings [ "GCC_PREPROCESSOR_DEFINITIONS" ] . strip ,
526+ '$(inherited) "SomeFlag=1" "_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"'
527+ )
528+ end
529+ end
530+
477531 # ==================================== #
478532 # Test - Set Node_Modules User Setting #
479533 # ==================================== #
0 commit comments