@@ -216,6 +216,35 @@ public void testCcImportWithVersionedSharedLibrary() throws Exception {
216216 .containsExactly ("bin _solib_k8/_U_S_Sa_Cfoo___Ua/libfoo.so.1ab2.1_a2" );
217217 }
218218
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+
219248 @ Test
220249 public void testCcImportWithInvalidVersionedSharedLibrary () throws Exception {
221250 checkError (
@@ -229,6 +258,19 @@ public void testCcImportWithInvalidVersionedSharedLibrary() throws Exception {
229258 ")" );
230259 }
231260
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+
232274 @ Test
233275 public void testCcImportWithInterfaceSharedLibrary () throws Exception {
234276 useConfiguration ("--cpu=k8" );
0 commit comments