diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonConfiguredTargetTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonConfiguredTargetTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonConfiguredTargetTest.java index 582400a740..abf21165dd 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonConfiguredTargetTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonConfiguredTargetTest.java @@ -519,6 +519,21 @@ public class CcCommonConfiguredTargetTest extends BuildViewTestCase { } @Test + public void testCcLibraryRootIncludesError() throws Exception { + checkError( + "root", + "lib", + // message: + "in includes attribute of cc_library rule //root:lib: '..' resolves to the workspace root, " + + "which would allow this rule and all of its transitive dependents to include any " + + "file in your workspace. Please include only what you need", + // build file: + "cc_library(name = 'lib',", + " srcs = ['foo.cc'],", + " includes = ['..'])"); + } + + @Test public void testStaticallyLinkedBinaryNeedsSharedObject() throws Exception { scratch.file( "third_party/sophos_av_pua/BUILD", |