@@ -751,14 +751,25 @@ public void testWhenStaticRuntimeLibAttributeMandatoryWhenSupportsEmbeddedRuntim
751
751
CcToolchainConfig .builder ()
752
752
.withFeatures (CppRuleClasses .STATIC_LINK_CPP_RUNTIMES )
753
753
.build ()
754
- .getCcToolchainConfigRule ());
754
+ .getCcToolchainConfigRule (),
755
+ "toolchain(" ,
756
+ " name = 'cc-toolchain-b'," ,
757
+ " toolchain_type = '" + TestConstants .TOOLS_REPOSITORY + "//tools/cpp:toolchain_type'," ,
758
+ " toolchain = ':b'," ,
759
+ " target_compatible_with = []," ,
760
+ " exec_compatible_with = []," ,
761
+ ")" );
755
762
analysisMock .ccSupport ().setupCcToolchainConfig (mockToolsConfig , CcToolchainConfig .builder ());
756
763
mockToolsConfig .create (
757
764
"a/cc_toolchain_config.bzl" ,
758
765
ResourceLoader .readFromResources (
759
766
"com/google/devtools/build/lib/analysis/mock/cc_toolchain_config.bzl" ));
760
767
reporter .removeHandler (failFastHandler );
761
- useConfiguration ("--crosstool_top=//a:a" , "--cpu=k8" , "--host_cpu=k8" );
768
+ useConfiguration (
769
+ "--extra_toolchains=//a:cc-toolchain-b" ,
770
+ "--crosstool_top=//a:a" ,
771
+ "--cpu=k8" ,
772
+ "--host_cpu=k8" );
762
773
assertThat (getConfiguredTarget ("//a:main" )).isNull ();
763
774
assertContainsEvent (
764
775
"Toolchain supports embedded runtimes, but didn't provide static_runtime_lib attribute." );
@@ -795,14 +806,26 @@ public void testWhenDynamicRuntimeLibAttributeMandatoryWhenSupportsEmbeddedRunti
795
806
.withFeatures (
796
807
CppRuleClasses .STATIC_LINK_CPP_RUNTIMES , CppRuleClasses .SUPPORTS_DYNAMIC_LINKER )
797
808
.build ()
798
- .getCcToolchainConfigRule ());
809
+ .getCcToolchainConfigRule (),
810
+ "toolchain(" ,
811
+ " name = 'cc-toolchain-b'," ,
812
+ " toolchain_type = '" + TestConstants .TOOLS_REPOSITORY + "//tools/cpp:toolchain_type'," ,
813
+ " toolchain = ':b'," ,
814
+ " target_compatible_with = []," ,
815
+ " exec_compatible_with = []," ,
816
+ ")" );
799
817
analysisMock .ccSupport ().setupCcToolchainConfig (mockToolsConfig , CcToolchainConfig .builder ());
800
818
mockToolsConfig .create (
801
819
"a/cc_toolchain_config.bzl" ,
802
820
ResourceLoader .readFromResources (
803
821
"com/google/devtools/build/lib/analysis/mock/cc_toolchain_config.bzl" ));
804
822
reporter .removeHandler (failFastHandler );
805
- useConfiguration ("--crosstool_top=//a:a" , "--cpu=k8" , "--host_cpu=k8" , "--dynamic_mode=fully" );
823
+ useConfiguration (
824
+ "--extra_toolchains=//a:cc-toolchain-b" ,
825
+ "--crosstool_top=//a:a" ,
826
+ "--cpu=k8" ,
827
+ "--host_cpu=k8" ,
828
+ "--dynamic_mode=fully" );
806
829
assertThat (getConfiguredTarget ("//a:test" )).isNull ();
807
830
assertContainsEvent (
808
831
"Toolchain supports embedded runtimes, but didn't provide dynamic_runtime_lib attribute." );
0 commit comments