diff options
author | 2015-11-19 15:14:48 +0000 | |
---|---|---|
committer | 2015-11-19 16:47:58 +0000 | |
commit | 49e3618209eae0f491d7a8183a8403d5438d5229 (patch) | |
tree | a3b4ba3c1cd3322ac165a11f9d2cd5e9f5418545 /src/test/java/com/google/devtools/build/lib/analysis/DuplicateActionTest.java | |
parent | 8b1a0947bfd9a059a886c4cc45242ddc2ccec003 (diff) |
Open-source DuplicateActionTest.
--
MOS_MIGRATED_REVID=108243939
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/analysis/DuplicateActionTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/DuplicateActionTest.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/DuplicateActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/DuplicateActionTest.java new file mode 100644 index 0000000000..89020e235c --- /dev/null +++ b/src/test/java/com/google/devtools/build/lib/analysis/DuplicateActionTest.java @@ -0,0 +1,46 @@ +//// 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. + +package com.google.devtools.build.lib.analysis; + +import com.google.devtools.build.lib.analysis.util.AnalysisTestCase; + +/** + * Tests for duplicate action detection and handling when incremental analysis is enabled. + */ +public class DuplicateActionTest extends AnalysisTestCase { + public void testDuplicateBuildInfoHeaderAction() throws Exception { + scratch.file("a/stamp.cc", + "// Empty." + ); + scratch.file("a/BUILD", + "cc_binary(name = 'a', srcs = ['a.cc'], deps = [':c'], stamp = 1)", + "cc_binary(name = 'b', srcs = ['b.cc'], deps = [':c'], stamp = 1)", + "cc_library(name = 'c', linkstamp = 'stamp.cc')"); + update("//a:a", "//a:b"); + assertFalse(hasErrors(getConfiguredTarget("//a:a"))); + assertFalse(hasErrors(getConfiguredTarget("//a:b"))); + } + + /** + * Same test with loading phase disabled. + */ + public static class DuplicateActionTestWithoutLoading extends DuplicateActionTest { + @Override + public void setUp() throws Exception { + disableLoading(); + super.setUp(); + } + } +} |