diff options
author | Googler <noreply@google.com> | 2017-02-08 14:37:22 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2017-02-08 15:52:25 +0000 |
commit | f5bb3d248ff1dd9e5157551bbf5052c61a7643ce (patch) | |
tree | 4a1cf59203887a3de1267b7659c2d90646fc2b5b /src/test/java/com/google | |
parent | 49d97f9bb4dd04ef62198ded7b53b2a8f8c603db (diff) |
Add a boolean flag to a Feature to specify whether it is enabled by default.
This enables us to configure default features for each toolchain without having
to hard-code anything in class such as CcCommon.
--
PiperOrigin-RevId: 146904287
MOS_MIGRATED_REVID=146904287
Diffstat (limited to 'src/test/java/com/google')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java index 52ebddbae2..188794f77d 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java @@ -1040,6 +1040,13 @@ public class CcToolchainFeaturesTest { assertThat(features.getFeatureConfiguration("b").getCommandLine(CppCompileAction.CPP_COMPILE, createVariables("v", "1"))).containsExactly("-f", "1"); } + + @Test + public void testDefaultFeatures() throws Exception { + CcToolchainFeatures features = + buildFeatures("feature { name: 'a' }", "feature { name: 'b' enabled: true }"); + assertThat(features.getDefaultFeatures()).containsExactly("b"); + } @Test public void testActivateActionConfigFromFeature() throws Exception { |