17
17
import static com .google .common .truth .Truth .assertThat ;
18
18
import static org .junit .Assert .assertThrows ;
19
19
20
- import com .google .common .base .Joiner ;
21
20
import com .google .common .base .Preconditions ;
22
21
import com .google .common .collect .ArrayListMultimap ;
23
22
import com .google .common .collect .ImmutableClassToInstanceMap ;
40
39
import com .google .devtools .build .lib .skyframe .serialization .ObjectCodecs ;
41
40
import com .google .devtools .build .lib .skyframe .serialization .testutils .RoundTripping ;
42
41
import com .google .devtools .build .lib .skyframe .serialization .testutils .SerializationTester ;
43
- import com .google .devtools .build .lib .vfs .PathFragment ;
44
42
import com .google .devtools .build .lib .view .config .crosstool .CrosstoolConfig .CToolchain ;
45
43
import com .google .errorprone .annotations .CanIgnoreReturnValue ;
46
- import com .google .protobuf .TextFormat ;
47
44
import java .util .List ;
48
45
import java .util .Objects ;
49
46
import javax .annotation .Nullable ;
@@ -83,15 +80,6 @@ private static CcToolchainVariables createVariables(String... entries) {
83
80
return variables .build ();
84
81
}
85
82
86
- /** Creates an empty CcToolchainFeatures. */
87
- private static CcToolchainFeatures buildEmptyFeatures (String ... toolchain ) throws Exception {
88
- CToolchain .Builder toolchainBuilder = CToolchain .newBuilder ();
89
- TextFormat .merge (Joiner .on ("" ).join (toolchain ), toolchainBuilder );
90
- return new CcToolchainFeatures (
91
- CcToolchainConfigInfo .fromToolchainForTestingOnly (toolchainBuilder .buildPartial ()),
92
- PathFragment .EMPTY_FRAGMENT );
93
- }
94
-
95
83
private static ImmutableSet <String > getEnabledFeatures (
96
84
CcToolchainFeatures features , String ... requestedFeatures ) throws Exception {
97
85
FeatureConfiguration configuration =
@@ -109,7 +97,7 @@ private static ImmutableSet<String> getEnabledFeatures(
109
97
public void testFeatureConfigurationCodec () throws Exception {
110
98
FeatureConfiguration emptyConfiguration =
111
99
FeatureConfiguration .intern (
112
- buildEmptyFeatures ("" ).getFeatureConfiguration (ImmutableSet .of ()));
100
+ CcToolchainTestHelper . buildFeatures ("" ).getFeatureConfiguration (ImmutableSet .of ()));
113
101
FeatureConfiguration emptyFeatures =
114
102
CcToolchainTestHelper .buildFeatures ("feature {name: 'a'}" , "feature {name: 'b'}" )
115
103
.getFeatureConfiguration (ImmutableSet .of ("a" , "b" ));
0 commit comments