aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar Yun Peng <pcloudy@google.com>2017-11-17 09:01:57 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-11-17 09:03:56 -0800
commit8731dc06915563b208a5c774b59bdb917c6ebbb0 (patch)
treeb749f9919d9bc9c34f7fcc9bf56e1dc24bcc185e /src/test/java/com
parent41584252323b8f4410b6aecb29db68cb7b6a2de8 (diff)
Add cc_import rule definition
Designed by https://docs.google.com/document/d/1hK2mWl3TYNL9oJYX_S020TKkXZvBw1aBoYERvTHVyfg/edit# Change-Id: I025adf555a9827c55a90acc3f254cbd105e224c6 PiperOrigin-RevId: 176114968
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportConfiguredTargetTest.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportConfiguredTargetTest.java
new file mode 100644
index 0000000000..e7fa1657cd
--- /dev/null
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportConfiguredTargetTest.java
@@ -0,0 +1,43 @@
+// Copyright 2015 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// Copyright 2006 Google Inc. All rights reserved.
+
+package com.google.devtools.build.lib.rules.cpp;
+
+import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/**
+ * "White-box" unit test of cc_import rule.
+ */
+@RunWith(JUnit4.class)
+public class CcImportConfiguredTargetTest extends BuildViewTestCase {
+
+ @Test
+ public void testCcImportRule() throws Exception {
+ scratch.file("third_party/BUILD",
+ "cc_import(",
+ " name = 'a_import',",
+ " static_library = 'A.a',",
+ " shared_library = 'A.so',",
+ " interface_library = 'A.ifso',",
+ " hdrs = ['a.h'],",
+ " alwayslink = 1,",
+ ")");
+ getConfiguredTarget("//third_party:a_import");
+ }
+}