aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/util
Commit message (Collapse)AuthorAge
* Redo FileType to reduce generated garbage.Gravatar tomlu2017-12-22
| | | | | | | | | | | | | * Change FileType to no longer assume it operates on just the base name (it can now be given a full path). * Move the responsibility to specific classes (Artifact, Path, PathFragment) to decide how they want to offer up a string that includes the file name. * Flip the order in which users are expected to check Artifact type, from FileType#matches(Artifact) to Artifact#isFileType(FileType). This looks natural and should encourage developers to use efficient file type checking methods. * Change CppCompileAction to use the new API. RELNOTES: None PiperOrigin-RevId: 179903239
* Automated rollback of commit 82e68b75304438c96ff878a0c2b8d18b42002486.Gravatar aehlig2017-12-19
| | | | | | | | | | | | | | Fixes #4322, #4306. *** Reason for rollback *** Introduces a deadlock (see https://github.com/bazelbuild/bazel/issues/4322) *** Original change description *** Make FileSystem operate on LocalPath instead of Path. PiperOrigin-RevId: 179549866
* Make FileSystem operate on LocalPath instead of Path.Gravatar tomlu2017-12-14
| | | | PiperOrigin-RevId: 179082062
* Move msys path support into DependencySet, removing it from the general Path ↵Gravatar tomlu2017-12-14
| | | | | | | | system. This is the only place that should actually need it. PiperOrigin-RevId: 179054861
* Adds a codec for RegexFilter.Gravatar Googler2017-12-13
| | | | PiperOrigin-RevId: 178942449
* Add a static method GroupedList#numElements to allow to count the number of ↵Gravatar shreyax2017-11-29
| | | | | | deps from a compressed GroupedList without uncompressing it. Also some minor GC improvements. PiperOrigin-RevId: 177338852
* Track Option placement within a priority category.Gravatar ccalvarin2017-10-18
| | | | | | | | | An option has precedence over previous options at the same enum-valued priority. Track its placement in this ordering explicitly. This will allow after-the-fact expansion of expansion options such that they correctly take precedence or not compared to other mentions of the same flag. This is needed to fix --config's expansion. RELNOTES: None. PiperOrigin-RevId: 172367996
* Make UnionFileSystem accept all paths Bazel can throw at it.Gravatar ccalvarin2017-09-27
| | | | | | | | | Instead of relying on a character-by-character StringTrie, segment paths based on PathFragments. This means UnionFS can accept any path that Bazel stores internally, removing the ASCII limitations. This also means removing the ability to have a filesystem bound for sub-PathFragments, /foo/barbar, /foo/barqux could have the same filesystem bound at /foo/bar. This feature was tested for when a use case was envisioned, but it was never used, so removing it is safe. RELNOTES: None. PiperOrigin-RevId: 170054656
* More BUILD file refactorings.Gravatar philwo2017-09-06
| | | | | | | | | Split collect, concurrent, vfs, windows into package-level BUILD files. Move clock classes out of "util", into their own Java package. Move CompactHashSet into its own Java package to break a dependency cycle. Give nestedset and inmemoryfs their own package-level BUILD files. PiperOrigin-RevId: 167702127
* Rewrite all code to use the new Java 8 java.time classes.Gravatar Philipp Wollermann2017-09-05
| | | | | | | This removes our dependency on third_party/joda_time, which can be removed in the next commit. Change-Id: Ibda131d34d0abdc2d675db4bfbd2e99480c055ee PiperOrigin-RevId: 167515260
* CommandBuilder.java: Don't quote the last argument when passing Windows ↵Gravatar pcloudy2017-08-18
| | | | | | | | | command to CMD.EXE. Fix https://github.com/bazelbuild/bazel/issues/2040#issuecomment-322980147 RELNOTES: None PiperOrigin-RevId: 165562681
* Make the @Option annotation depend on the java version of the tagging enums.Gravatar ccalvarin2017-07-18
| | | | | | | The option filters proto dependency can be removed from the OptionsParser. This is in response to option parser users that want to avoid the bazel-internal proto file in their dependencies. RELNOTES: None. PiperOrigin-RevId: 162249778
* Fold OptionUsageRestrictions into OptionDocumentationCategory and ↵Gravatar ccalvarin2017-07-11
| | | | | | | | | | OptionMetadataTags. These are similar, no need to have both fields. Removing the "DOCUMENTED" default, the absence of UNDOCUMENTED will be used instead. Since requiring a documentation category for undocumented options doesn't make sense, list that as one of the OptionDocumentationCategories, but list HIDDEN and INTERNAL as part of OptionMetadata. These options should list UNDOCUMENTED as their category. PiperOrigin-RevId: 161515674
* Cleanup for Java 8Gravatar laurentlb2017-07-05
| | | | PiperOrigin-RevId: 160832316
* Explicitly state the default options categories for options used in blaze ↵Gravatar ccalvarin2017-06-29
| | | | | | | | testing. Unlike in the production flags, these flags are only used for internal testing. Tagged them as NO_OP instead of the default UNKNOWN to make it clear that we do not need these to become properly tagged. PiperOrigin-RevId: 160526472
* Migrate most of the assertions to Truth that the auto-migration tool did not ↵Gravatar lberki2017-05-31
| | | | | | | | | catch. IntelliJ's "replace structurally" command was surprisingly useful. RELNOTES: None. PiperOrigin-RevId: 157463734
* Migrate Java tests to Truth.Gravatar lberki2017-05-30
| | | | | | RELNOTES: None. PiperOrigin-RevId: 157446717
* Fixes incorrectly-ordered arguments to calls to assertEqualsGravatar Googler2017-05-19
| | | | | | | | | | | | | | | [] This change has been automatically generated by an Error Prone check that detects incorrect argument ordering on calls to assertEquals-style methods. See [] Cleanup change automatically generated by javacflume/refactory Refactoring: third_party/java_src/error_prone/project/core/src/main/java/com/google/errorprone/bugpatterns/argumentselectiondefects:AssertEqualsArgumentOrderChecker_refactoring Tested: TAP --sample for global presubmit queue [] PiperOrigin-RevId: 156539781
* Remove the overloading of option category to cover documentation level.Gravatar ccalvarin2017-04-18
| | | | | | | | This prevents having to parse the category, and allows the category to potentially be used in the future for information about all options, included undocumented, hidden, or internal options. Also rename DocumentationLevel to OptionUsageRestrictions, since INTERNAL was not really documentation related. PiperOrigin-RevId: 153367769
* Add a custom single-line formatter for java.log.Gravatar schmitt2017-04-13
| | | | | | | | This logger makes it easier to parse log statements and is now enabled for Bazel's java.log. RELNOTES[INC]: Bazel now prints logs in single lines to java.log PiperOrigin-RevId: 152954337
* Do not trample the PersistentMap journalGravatar Benjamin Peterson2017-04-07
| | | | | | | | | | | | | | | This fixes https://github.com/bazelbuild/bazel/issues/2660. Basically, if we elect to keep the journal during PersistentMap.save(), we shouldn't stomp over it the next time save() is called. In writeJournal(), we now check if the journal file exists, and open it in append mode if it does. Alternatively, we could simply not close (and thus forget about) the journal in save(), but that would leak the journal file handle if save() was never called with keepJournal() returning false. Change-Id: Id00732f161c8b5a082a6c109aee115591ace2ea7 PiperOrigin-RevId: 152480978
* Refactor all ctor callsites of PathFragment to instead call a static ↵Gravatar nharmata2017-04-05
| | | | | | | | | | | | 'create' method. This paves the way for changing PathFragment to e.g. an abstract class with multiple subclasses. This way we can split out the windows-specific stuff into one of these concrete classes, making the code more readable and also saving memory (since the shallow heap size of the NonWindowsPathFragment subclass will hopefully be smaller than that of the current PathFragment). This also lets us pursue gc churn optimizations. We can now do interning in PathFragment#create and can also get rid of unnecessary intermediate PathFragment allocations. RELNOTES: None PiperOrigin-RevId: 152145768
* Add new utility function to encode options as argument list Gravatar Klaus Aehlig2017-03-23
| | | | | | | | | | | ...in a way preserving the list structure and without escaping. In other words, return the options as needed for an execve(3) call. -- Change-Id: Ifb168d2e720392fb3a97d557960e0c1f1a83f543 Reviewed-on: https://cr.bazel.build/9458 PiperOrigin-RevId: 151019830 MOS_MIGRATED_REVID=151019830
* Make the spell checker a bit more conservative.Gravatar Laurent Le Brun2017-03-21
| | | | | | | | | Reduce the max spell-checking distance for matching words. "target" will not match "range" anymore. -- PiperOrigin-RevId: 150638073 MOS_MIGRATED_REVID=150638073
* Move UnixFileSystem to lib.unix, WindowsFileSystem to lib.windowsGravatar Ulf Adams2017-02-28
| | | | | | -- PiperOrigin-RevId: 148749485 MOS_MIGRATED_REVID=148749485
* Move ProcMeminfoParser to lib.unix, where it belongsGravatar Ulf Adams2017-01-09
| | | | | | -- PiperOrigin-RevId: 143939410 MOS_MIGRATED_REVID=143939410
* Streamline Fingerprint implementationGravatar Michajlo Matijkiw2016-12-15
| | | | | | | | | | | | Thread all updates through a CodedOutputStream. This has the benefit of potentially hashing less data, as many int values can be represented more compactly, and reducing the churn of hashing strings (generally), since CodedOutputStream is already heavily optimized for this. While the buffer size is a little generous, it winds up paying off. -- PiperOrigin-RevId: 142151062 MOS_MIGRATED_REVID=142151062
* Use MessageDigest instead of HashFunction for FingerprintGravatar Michajlo Matijkiw2016-12-01
| | | | | | | | | This allows us to reset and reuse the underlying digest implementation, which guava's HashFunction doesn't allow. We do take the clone-if-possible page out of guava's book. -- MOS_MIGRATED_REVID=140624836
* Implement build tag filtering.Gravatar Lukacs Berki2016-11-11
| | | | | | | If the --build_tag_filters option is specified, targets built will be filtered according to their tags (at least one included, none excluded) -- MOS_MIGRATED_REVID=138856195
* Stop consulting the environment for "originating user" information.Gravatar Googler2016-11-03
| | | | | -- MOS_MIGRATED_REVID=138039276
* If a group of deps has only one unique element, store it bare.Gravatar Janak Ramakrishnan2016-10-25
| | | | | | | | | | Not storing it bare both breaks equality comparison for GroupedList and uses more space. -- Change-Id: Iaf4f88908ecf4293cfc31dbd896f46e1da3b4184 Reviewed-on: https://bazel-review.googlesource.com/#/c/6850/ MOS_MIGRATED_REVID=137099785
* Fix unnecessary static imports of typesGravatar Liam Miller-Cushon2016-10-18
| | | | | -- MOS_MIGRATED_REVID=136431274
* Stop storing a set in GroupedListHelper to deduplicate SkyKey dep requests. ↵Gravatar Janak Ramakrishnan2016-10-14
| | | | | | | Instead, deduplicate when the helper is actually added to a GroupedList. -- MOS_MIGRATED_REVID=136145321
* Rollback of commit 0e9a1b2d51f9e03f4493e52d23cb3efc568be59f.Gravatar Googler2016-10-07
| | | | | | | | | | | | | | *** Reason for rollback *** [] hasn't released unknown commit yet. We need to keep the old behavior until then. *** Original change description *** Stop consulting the environment for "originating user" information. -- MOS_MIGRATED_REVID=135441115
* Stop consulting the environment for "originating user" information.Gravatar Googler2016-10-07
| | | | | -- MOS_MIGRATED_REVID=135422529
* Remove Fingerprint.toString() to avoid relying on MessageDigest.clone().Gravatar Googler2016-07-04
| | | | | -- MOS_MIGRATED_REVID=126566280
* Move LoggingTerminalWriter out of testGravatar Klaus Aehlig2016-06-27
| | | | | | | | | ...so that it can be used by the main code base. -- Change-Id: Ibf59d74ab1b0cca9bd9406bb76ee6e71189653bf Reviewed-on: https://bazel-review.googlesource.com/#/c/3903 MOS_MIGRATED_REVID=125950656
* Optimize hotspot in DependencySet.process().Gravatar Googler2016-06-14
| | | | | -- MOS_MIGRATED_REVID=124744073
* Make a 'did you mean' suggestion when referencing a non-existent label.Gravatar Laurent Le Brun2016-06-06
| | | | | | | It works for both labels on the command-line and labels in BUILD files. -- MOS_MIGRATED_REVID=123967347
* Add a SpellChecker class with edit distance function.Gravatar Laurent Le Brun2016-06-01
| | | | | | | This will be used later to detect typos and provide suggestions. -- MOS_MIGRATED_REVID=123761611
* Simplify DependencySet.Gravatar Ulf Adams2016-05-19
| | | | | | | | | | - mark the addDependencies method as @VisibleForTesting, and don't round-trip through PathFragment - use Path.getRelative(String) instead of Path.getRelative(PathFragment), which may do additional optimizations -- MOS_MIGRATED_REVID=122720947
* Rollback of commit 7f339de7feb071d790ecbca1c346244f5794a7e3.Gravatar Greg Estren2016-05-13
| | | | | | | | | | | | | | | | | *** Reason for rollback *** This is breaking ~1,000 tests in the latest Blaze nightly: [] Per sheriff policy, we need to either roll back or provide a quick fix tonight. *** Original change description *** Optimize hotspot in DependencySet.process(). -- MOS_MIGRATED_REVID=122220429
* Optimize hotspot in DependencySet.process().Gravatar Googler2016-05-12
| | | | | -- MOS_MIGRATED_REVID=122050015
* Support case-insensitive comparision in Path.java with WindowsFileSystemGravatar Yun Peng2016-05-09
| | | | | | | | Since file path is case-insensitive on Windows, we need to support this. Also fixed .d file inclusions check in CppCompileAction.java on Windows -- MOS_MIGRATED_REVID=121823250
* Add random-access indexing into GroupedList. Intended to be a no-op, ↵Gravatar Janak Ramakrishnan2016-04-28
| | | | | | | allowing for future work that may want to access a particular group in the GroupedList without advancing the iterator. -- MOS_MIGRATED_REVID=120933039
* Add nullable variants to Fingerprint.Gravatar Ulf Adams2016-04-20
| | | | | -- MOS_MIGRATED_REVID=120325869
* Make LineWrappingAnsiTerminalWriter more efficientGravatar Klaus Aehlig2016-04-15
| | | | | | | | | | ...by only starting the new line, if needed and not already if the last usable character of the line is written. -- Change-Id: I86519389fe64fe74ba9045be07483ce5f55d5e9a Reviewed-on: https://bazel-review.googlesource.com/#/c/3384 MOS_MIGRATED_REVID=119949042
* Add a position-aware wrapper around AnsiTerminalWriterGravatar Klaus Aehlig2016-04-15
| | | | | | | | | | | | | When generating output targeted for a specific terminal width, it is important to know the current position in order to appropriately shorten the message still to be added to the current line. So make it possible to add this functionality to the terminal writer itself, to avoid too many lengthy position computations at call site. -- Change-Id: I03400b9544c32567fc6ea7ab35e742c4ccd7b610 Reviewed-on: https://bazel-review.googlesource.com/#/c/3373 MOS_MIGRATED_REVID=119946982
* Move LoggingTerminalWriter to a public util classGravatar Klaus Aehlig2016-04-15
| | | | | | | | | | In this way, it can be used for other tests as well. While there, also unify the two almost identical private LoggingTerminalWriter classes. -- Change-Id: I9cdf9eb235110a0ad6b9514012a92a923d219b53 Reviewed-on: https://bazel-review.googlesource.com/#/c/3372 MOS_MIGRATED_REVID=119943441
* Revamp the client/server communication protocol so that it is portable to ↵Gravatar Lukacs Berki2016-03-22
| | | | | | | | | Windows. Progress towards #930. -- MOS_MIGRATED_REVID=117799006