@@ -216,6 +216,35 @@ public void testCcImportWithVersionedSharedLibrary() throws Exception {
216
216
.containsExactly ("bin _solib_k8/_U_S_Sa_Cfoo___Ua/libfoo.so.1ab2.1_a2" );
217
217
}
218
218
219
+ @ Test
220
+ public void testCcImportWithVersionedSharedLibraryWithDotInTheName () throws Exception {
221
+ useConfiguration ("--cpu=k8" );
222
+
223
+ ConfiguredTarget target =
224
+ scratchConfiguredTarget (
225
+ "a" ,
226
+ "foo" ,
227
+ starlarkImplementationLoadStatement ,
228
+ "cc_import(name = 'foo', shared_library = 'libfoo.qux.so.1ab2.1_a2')" );
229
+
230
+ Artifact dynamicLibrary =
231
+ target
232
+ .get (CcInfo .PROVIDER )
233
+ .getCcLinkingContext ()
234
+ .getLibraries ()
235
+ .getSingleton ()
236
+ .getResolvedSymlinkDynamicLibrary ();
237
+ Iterable <Artifact > dynamicLibrariesForRuntime =
238
+ target
239
+ .get (CcInfo .PROVIDER )
240
+ .getCcLinkingContext ()
241
+ .getDynamicLibrariesForRuntime (/* linkingStatically= */ false );
242
+ assertThat (artifactsToStrings (ImmutableList .of (dynamicLibrary )))
243
+ .containsExactly ("src a/libfoo.qux.so.1ab2.1_a2" );
244
+ assertThat (artifactsToStrings (dynamicLibrariesForRuntime ))
245
+ .containsExactly ("bin _solib_k8/_U_S_Sa_Cfoo___Ua/libfoo.qux.so.1ab2.1_a2" );
246
+ }
247
+
219
248
@ Test
220
249
public void testCcImportWithInvalidVersionedSharedLibrary () throws Exception {
221
250
checkError (
@@ -229,6 +258,19 @@ public void testCcImportWithInvalidVersionedSharedLibrary() throws Exception {
229
258
")" );
230
259
}
231
260
261
+ @ Test
262
+ public void testCcImportWithInvalidSharedLibraryNoExtension () throws Exception {
263
+ checkError (
264
+ "a" ,
265
+ "foo" ,
266
+ "does not produce any cc_import shared_library files " + "(expected" ,
267
+ starlarkImplementationLoadStatement ,
268
+ "cc_import(" ,
269
+ " name = 'foo'," ,
270
+ " shared_library = 'libfoo'," ,
271
+ ")" );
272
+ }
273
+
232
274
@ Test
233
275
public void testCcImportWithInterfaceSharedLibrary () throws Exception {
234
276
useConfiguration ("--cpu=k8" );
0 commit comments