Search in sources :

Example 21 with ImmutableMap

use of org.apache.beam.vendor.calcite.v1_28_0.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"));
}
Also used : CxxPlatform(com.facebook.buck.cxx.CxxPlatform) ImmutableMap(com.google.common.collect.ImmutableMap) Test(org.junit.Test)

Example 22 with ImmutableMap

use of org.apache.beam.vendor.calcite.v1_28_0.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)));
}
Also used : CxxPlatform(com.facebook.buck.cxx.CxxPlatform) ImmutableMap(com.google.common.collect.ImmutableMap) LinkedHashMap(java.util.LinkedHashMap) Test(org.junit.Test)

Example 23 with ImmutableMap

use of org.apache.beam.vendor.calcite.v1_28_0.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"));
}
Also used : CxxPlatform(com.facebook.buck.cxx.CxxPlatform) ImmutableMap(com.google.common.collect.ImmutableMap) Test(org.junit.Test)

Example 24 with ImmutableMap

use of org.apache.beam.vendor.calcite.v1_28_0.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"));
}
Also used : CxxPlatform(com.facebook.buck.cxx.CxxPlatform) ImmutableMap(com.google.common.collect.ImmutableMap) Test(org.junit.Test)

Example 25 with ImmutableMap

use of org.apache.beam.vendor.calcite.v1_28_0.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));
}
Also used : CxxPlatform(com.facebook.buck.cxx.CxxPlatform) ImmutableMap(com.google.common.collect.ImmutableMap) LinkedHashMap(java.util.LinkedHashMap) Test(org.junit.Test)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1261 Map (java.util.Map)662 Test (org.junit.Test)309 ImmutableList (com.google.common.collect.ImmutableList)300 List (java.util.List)288 HashMap (java.util.HashMap)269 ImmutableSet (com.google.common.collect.ImmutableSet)211 IOException (java.io.IOException)202 Optional (java.util.Optional)190 Set (java.util.Set)168 ArrayList (java.util.ArrayList)158 Path (java.nio.file.Path)151 Collectors (java.util.stream.Collectors)133 File (java.io.File)117 ImmutableMap.toImmutableMap (com.google.common.collect.ImmutableMap.toImmutableMap)102 Collection (java.util.Collection)93 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)85 Test (org.testng.annotations.Test)85 HashSet (java.util.HashSet)83 Collections (java.util.Collections)78