diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/packages/util/SubincludePreprocessor.java | 72 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java | 7 |
2 files changed, 0 insertions, 79 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/SubincludePreprocessor.java b/src/test/java/com/google/devtools/build/lib/packages/util/SubincludePreprocessor.java deleted file mode 100644 index 28c0ef972f..0000000000 --- a/src/test/java/com/google/devtools/build/lib/packages/util/SubincludePreprocessor.java +++ /dev/null @@ -1,72 +0,0 @@ -// 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.packages.util; - -import com.google.devtools.build.lib.packages.CachingPackageLocator; -import com.google.devtools.build.lib.packages.Globber; -import com.google.devtools.build.lib.packages.Preprocessor; -import com.google.devtools.build.lib.syntax.ParserInputSource; -import com.google.devtools.build.lib.vfs.FileSystem; -import com.google.devtools.build.lib.vfs.FileSystemUtils; -import com.google.devtools.build.lib.vfs.Path; -import java.io.IOException; -import java.util.Set; - -/** - * Expands subinclude() statements, and returns an error if ERROR is - * present in the end-result. It does not run python, and is intended - * for testing - */ -public class SubincludePreprocessor implements Preprocessor { - /** Creates SubincludePreprocessor factories. */ - public static class FactorySupplier implements Preprocessor.Factory.Supplier { - @Override - public Factory getFactory(CachingPackageLocator loc, Path outputBase) { - final SubincludePreprocessor preprocessor = - new SubincludePreprocessor(outputBase.getFileSystem(), loc); - return new Factory() { - @Override - public boolean isStillValid() { - return true; - } - - @Override - public boolean considersGlobs() { - return false; - } - - @Override - public Preprocessor getPreprocessor() { - return preprocessor; - } - }; - } - } - - /** Constructs a SubincludePreprocessor. Arguments are ignored. The class will be removed soon. */ - public SubincludePreprocessor(FileSystem fileSystem, CachingPackageLocator packageLocator) {} - - @Override - public Preprocessor.Result preprocess( - Path buildFilePath, - byte[] buildFileBytes, - String packageName, - Globber globber, - Set<String> ruleNames) - throws IOException, InterruptedException { - char content[] = FileSystemUtils.convertFromLatin1(buildFileBytes); - return Preprocessor.Result.noPreprocessing( - ParserInputSource.create(content, buildFilePath.asFragment())); - } -} diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java index b5a6000a43..2a0042665c 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java @@ -30,8 +30,6 @@ import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.packages.ConstantRuleVisibility; import com.google.devtools.build.lib.packages.NoSuchTargetException; -import com.google.devtools.build.lib.packages.Preprocessor; -import com.google.devtools.build.lib.packages.util.SubincludePreprocessor; import com.google.devtools.build.lib.pkgcache.PackageCacheOptions; import com.google.devtools.build.lib.pkgcache.PathPackageLocator; import com.google.devtools.build.lib.skyframe.util.SkyframeExecutorTestUtils; @@ -91,11 +89,6 @@ public class PackageFunctionTest extends BuildViewTestCase { } @Override - protected Preprocessor.Factory.Supplier getPreprocessorFactorySupplier() { - return new SubincludePreprocessor.FactorySupplier(); - } - - @Override protected FileSystem createFileSystem() { return fs; } |