use of com.google.common.collect.ImmutableMap in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasIphoneOsSdkRootTakenFromIphoneSimulatorFlavor.
@Test
public void testResultHasIphoneOsSdkRootTakenFromIphoneSimulatorFlavor() {
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setFlavor(InternalFlavor.of("iphonesimulator-x86_64")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, new LinkedHashMap<String, String>());
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get(CxxPlatformXcodeConfigGenerator.SDKROOT), Matchers.equalTo("iphoneos"));
}
use of com.google.common.collect.ImmutableMap in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasCxxLanguageStardardValueTakenFromAppendConfigIfPresent.
@Test
public void testResultHasCxxLanguageStardardValueTakenFromAppendConfigIfPresent() {
LinkedHashMap<String, String> appendConfig = new LinkedHashMap<String, String>();
appendConfig.put(CxxPlatformXcodeConfigGenerator.CLANG_CXX_LANGUAGE_STANDARD, "value");
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setCxxflags(ImmutableList.of("-std=cxxflagsvalue")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, appendConfig);
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get(CxxPlatformXcodeConfigGenerator.CLANG_CXX_LANGUAGE_STANDARD), Matchers.equalTo(appendConfig.get(CxxPlatformXcodeConfigGenerator.CLANG_CXX_LANGUAGE_STANDARD)));
}
use of com.google.common.collect.ImmutableMap in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasMacOsxSdkRootTakenFromMacOsxFlavor.
@Test
public void testResultHasMacOsxSdkRootTakenFromMacOsxFlavor() {
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setFlavor(InternalFlavor.of("macosx-12.0")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, new LinkedHashMap<String, String>());
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get(CxxPlatformXcodeConfigGenerator.SDKROOT), Matchers.equalTo("macosx"));
}
use of com.google.common.collect.ImmutableMap in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasCxxLibraryValueTakenFromPlatformCxxflags.
@Test
public void testResultHasCxxLibraryValueTakenFromPlatformCxxflags() {
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setCxxflags(ImmutableList.of("-stdlib=somevalue")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, new LinkedHashMap<String, String>());
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get(CxxPlatformXcodeConfigGenerator.CLANG_CXX_LIBRARY), Matchers.equalTo("somevalue"));
}
use of com.google.common.collect.ImmutableMap in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testAllBuildConfigurationsHaveSameConfigs.
@Test
public void testAllBuildConfigurationsHaveSameConfigs() {
final String someCrazyKey = "SOME_CRAZY_KEY";
LinkedHashMap<String, String> appendConfig = new LinkedHashMap<String, String>();
appendConfig.put(someCrazyKey, "value");
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setFlavor(InternalFlavor.of("macosx-12.0")).setCxxflags(ImmutableList.of("-Wno-warning", "-someflag", "-mmacosx-version-min=10.8")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, appendConfig);
ImmutableMap<String, String> debugConfig = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
ImmutableMap<String, String> releaseConfig = buildConfigs.get(CxxPlatformXcodeConfigGenerator.RELEASE_BUILD_CONFIGURATION_NAME);
ImmutableMap<String, String> profileConfig = buildConfigs.get(CxxPlatformXcodeConfigGenerator.PROFILE_BUILD_CONFIGURATION_NAME);
assertThat(debugConfig, Matchers.equalTo(releaseConfig));
assertThat(releaseConfig, Matchers.equalTo(profileConfig));
}
Aggregations