aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/testutil
Commit message (Collapse)AuthorAge
* Move BazelLibrary from syntax/ to packages/Gravatar brandjon2018-05-01
| | | | | | | | | This helps the Skylark interpreter to not depend on Bazel concepts, though it adds a temporary dependency of Skylint on packages/. The fix for that will be to create a Build API interface for BazelLibrary (e.g., "BazelLibraryAPI"). Refactored some GlobalFrame construction logic to be more uniform. Instead of constructing a whole Environment just to get a frame, we build the frame directly, using ImmutableMap.Builder to accumulate bindings. This convention may further change once we convert MethodLibrary and the like to @SkylarkGlobalLibrary, but for now it's more readable. RELNOTES: None PiperOrigin-RevId: 194960824
* Make the constructor of TemplateVariableInfo available in Skylark.Gravatar lberki2018-04-24
| | | | | | RELNOTES[NEW]: TemplateVariableInfo can now be constructed from Skylark. PiperOrigin-RevId: 194072452
* Remove some unnecessary params.Gravatar nharmata2018-04-02
| | | | | RELNOTES: None PiperOrigin-RevId: 191354727
* Remove synchronization in ↵Gravatar nharmata2018-03-23
| | | | | | | | | | | BazelPackageBuilderHelperForTesting#sanityCheckBazelPackageLoader. I should have written this comment more precisely. I am sorry I didn't. I vaguely recall some issues where the PackageFactory usage would do some scan of all the skylark classes and do some mutation to global state (this wouldn't normally be a problem since for blaze/bazel, there's one PackageFactory instance created per blaze/bazel server, and it's created at the beginning of the server). Nevertheless, I do not see any problems now. RELNOTES: None PiperOrigin-RevId: 190229913
* Victory lap: Remove all code that used to support the three-argument form of ↵Gravatar lberki2018-03-23
| | | | | | | vardef(). RELNOTES: None. PiperOrigin-RevId: 190196933
* Allow BazelPackageLoader to load external repositories.Gravatar carmi2018-03-13
| | | | | | | | | Also, disallow BazelPackageLoader from fetching missing external repos. Integration tests for BazelPackageLoader wrt external repos will be left for a follow-up CL. RELNOTES: None. PiperOrigin-RevId: 188967694
* tests: add TimestampGranularityUtilsGravatar laszlocsomor2018-03-13
| | | | | | | | | | | | | | Add a new test utility class TimestampGranularityUtils which offers methods to wait for the filesystem timestamp granularity to pass. Such waiting is necessary if a test asserts changes in a file's mtime or ctime. This is a follow-up to comments on https://github.com/bazelbuild/bazel/commit/a31e035fb42aa8db9fd248ef2ebd665a411053b8. PiperOrigin-RevId: 188847729
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* Introduce an Extrema aggregator.Gravatar nharmata2018-02-28
| | | | | RELNOTES: None PiperOrigin-RevId: 187370833
* Introduce cc_configure_lib.bzl#split_escapedGravatar hlopko2018-02-27
| | | | | | | | This function allows us to split strings coming from env variables into lists while respecting %-escaping. RELNOTES: None. PiperOrigin-RevId: 187166226
* expectThrows has been renamed to assertThrowsGravatar cushon2018-02-24
| | | | | | More information: https://github.com/junit-team/junit5/issues/531 PiperOrigin-RevId: 186900384
* Cleanup unused constantGravatar hlopko2018-02-23
| | | | | | | Should've been done in https://github.com/bazelbuild/bazel/commit/1a0e2e653c878c36b07880a0d31827fc8ddca353 RELNOTES: None. PiperOrigin-RevId: 186757061
* Create function createJavaInfo with new API. Implement ↵Gravatar dbabkin2018-01-23
| | | | | | | | | | | JavaRuleOutputJarsProvider. Added tests for checking JavaRuleOutputJarsProvider state. Moved all test cases related to JavaInfo to new file JavaInfoSkylarkApiTest.java Created RuleBuilder inside JavaInfoSkylarkApiTest to reduce duplication of code. RELNOTES:none PiperOrigin-RevId: 182901118
* Simplify the toolchain test case setup.Gravatar jcater2018-01-19
| | | | | | Also add a new appendFile method on Scratch. PiperOrigin-RevId: 182558199
* Use linux-sandbox via the (new) LinuxSandboxUtil. (second attempt).Gravatar ruperts2017-12-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 179705357
* Automated rollback of commit 52b62164af031c50b7a0584303caad67af5e1d4d.Gravatar aehlig2017-12-20
| | | | | | | | | | | | | *** Reason for rollback *** Breaks //src/test/shell/bazel:bazel_sandboxing_test *** Original change description *** Use linux-sandbox via the (new) LinuxSandboxUtil. RELNOTES: None. PiperOrigin-RevId: 179676894
* Use linux-sandbox via the (new) LinuxSandboxUtil.Gravatar ruperts2017-12-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 179646155
* Make ProcessWrapperUtil aware of the execution statistics file, and add new ↵Gravatar ruperts2017-12-05
| | | | | | | ExecutionStatisticsProvider. RELNOTES: None. PiperOrigin-RevId: 178056182
* Replace truth.FailureStrategy with truth.FailureMetadata in bazel's Subjects.Gravatar Googler2017-11-10
| | | | | | | | | | Also changed truth.SubjectFactory to truth.Subject.Factory (plain renaming) and use method reference instead of anonymous class to create the factory when applicable. FailureMetadata, an opaque object to its users, is introduced to replace FailureStrategy in in custom Subject in order to resolve some existing flaws of FailureStrategy as well as enable new features to be added to Truth. New API is available in Truth-0.36, if there is a build/pom.xml, it's also updated to use this version. PiperOrigin-RevId: 175308179
* Replace all usages of Blaze's Preconditions class with guava.Gravatar tomlu2017-11-09
| | | | | | | | Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own. This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually. PiperOrigin-RevId: 175033526
* Thread FileSystem through to a single Path#delete call site.Gravatar tomlu2017-10-30
| | | | | | This requires a fairly large amount of changes to fundamental objects like BlazeRuntime, Executor, and so on, as well as changing a lot of test code to thread the file system through. I expect future CLs to be much smaller. PiperOrigin-RevId: 173678144
* Allow/require callers of AbstractPackageLoader to set Skylark semantics ↵Gravatar brandjon2017-10-27
| | | | | | | | | | | explicitly Previously the default semantics were used unconditionally. Allowing non-default semantics is a feature. Requiring semantics to be specified explicitly helps to avoid unintentional divergence from the caller's intended semantics. We recently did the same thing for Skylark's Environment.Builder (https://github.com/bazelbuild/bazel/commit/b368b39f8ba1e8e8a67af50e5ade9127b2b149d7). Also pass Skylark semantics through Package.Builder.Helper, so that the extra verification done for shell tests uses the same semantics as the build. RELNOTES: None PiperOrigin-RevId: 173544885
* Add platform_common.MakeVariableInfo so that Skylark code has access to the ↵Gravatar lberki2017-10-27
| | | | | | | Make variables provider. RELNOTES: None. PiperOrigin-RevId: 173527191
* Disable some tests that can't currently run in special internal execution mode.Gravatar janakr2017-10-13
| | | | PiperOrigin-RevId: 172007131
* Small refactoring of AnalysisTestCase to allow alternate SkyframeExecutor ↵Gravatar janakr2017-10-11
| | | | | | implementations. PiperOrigin-RevId: 171730718
* Move SkylarkSemanticsOptions to the packages/ directory, alongside ↵Gravatar brandjon2017-10-07
| | | | | | | | | SkylarkSemanticsCodec Note that the syntax package and its test package still depend indirectly on the options parser via other Bazel-specific packages. RELNOTES: None PiperOrigin-RevId: 171342823
* Pass SkylarkSemantics through Skyframe instead of the options classGravatar brandjon2017-10-06
| | | | | | | Also remove the use of the @UsesOnlyCoreTypes annotation on SkylarkSemanticsOptions. It was only there to help mark that the options class was safe to put in Skyframe. RELNOTES: None PiperOrigin-RevId: 171248504
* Add expectThrows to MoreAsserts until we can use JUnit 4.13.Gravatar jcater2017-09-18
| | | | PiperOrigin-RevId: 168883984
* Open source tests for Android desugarer.Gravatar ajmichael2017-09-14
| | | | | | | These tests will fail with a helpful error message if you do not have android_sdk_repository set up. They currently require that platform 25 be installed in your SDK. RELNOTES: None PiperOrigin-RevId: 168570577
* Add a new toolchain type for c++. In order to do this, ↵Gravatar cpeyser2017-09-08
| | | | | | | | PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 167901210
* RuleContext instances obtained through BuildViewTestCase#getRuleContext have aGravatar cpeyser2017-09-07
| | | | | | ToolchainContext. PiperOrigin-RevId: 167729868
* 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
* Make Make variables from genrule.toolchains override the usual synthetic ↵Gravatar lberki2017-09-04
| | | | | | | | | host JAVA/JAVABASE attributes. Also fix a few lint warnings and move a class so that it's closer to where it's actually used. RELNOTES: None. PiperOrigin-RevId: 167501208
* Open source some objc tests. Most notably, proto and j2objc tests still ↵Gravatar cparsons2017-08-28
| | | | | | | remain, but will follow. RELNOTES: None. PiperOrigin-RevId: 166635306
* Rename some of native declared providers according to the new naming scheme.Gravatar dslomov2017-08-21
| | | | | RELNOTES: None PiperOrigin-RevId: 165910455
* Make the print function output debug messagesGravatar vladmos2017-08-11
| | | | | RELNOTES: The `print` function now prints debug messages instead of warnings. PiperOrigin-RevId: 164880003
* Move MakeVariableProvider to lib.analysisGravatar ulfjack2017-08-08
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164456961
* Move RuleConfiguredTargetFactory to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164446955
* Add hook to process SkyframeExecutor in tests. Also add sentinel exception ↵Gravatar janakr2017-07-25
| | | | | | to indicate unserializability, improve error message in Path when serialization fails, and add some test-only methods to SkyframeExecutor and PackageFactory. PiperOrigin-RevId: 162993806
* Add an Iterable<Event> Truth subject so that we can easily assert things on ↵Gravatar janakr2017-07-24
| | | | | | | | | | an iterable of events without calling into the heavyweight MoreAsserts. Use that in Skyframe instead of MoreAsserts. Also delete an unused method in MoreAsserts. PiperOrigin-RevId: 162754283
* ResourceFilter supports dynamically configured resource filteringGravatar Googler2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dynamically Configured Resource Filtering change 3/6 Resource filtering behaves somewhat differently when dynamically configured. Resources obtained from dependencies will have already been filtered and do not need to be filtered again. Resources that were filtered out do not need to be tracked since resource processing will never receive a reference to them anyway. Also, to make builds where ResourceFilter is dynamically configured, add equals and hashCode methods (otherwise, the configuration code throws a NullPointerException) and a global output prefix (otherwise, conflicts can occur). To ensure that the global output prefix (and the ResourceFilter object itself) is the same regardless of the ordering of filters in the android_binary, build the filters into a set, not a list, and sort them as part of creating the ResourceFilter object. This way, for example, objects built with filters "en,fr", "fr,en", and "en,en,fr" will all end up equal. Finally, rename the getFilteredResources method to better reflect its new role, and improve the isPrefiltering method to not try to prefilter if there are no filters. Add tests for all of this, and helper methods for all of those tests, including, most notably, a makeResourceFilter method that instantiates a ResourceFilter similarly to how it is actually created outside of tests (rather than directly calling the constructor) and a fake implementation of AttributeMap to support this. RELNOTES: none PiperOrigin-RevId: 162099178
* Add a toolchains= attribute to *_binary, *_test, cc_library and extra_action ↵Gravatar lberki2017-07-14
| | | | | | | | | rules to declare which Make variables they need. The idea is that they would depend on the future java_runtime_alias / cc_toolchain_alias and similar rules and thus Bazel will know which Make variables they actually need instead of pulling in the whole BuildConfiguration and also making it possible to compute these Make variables during analysis instead of configuration creation. RELNOTES: None. PiperOrigin-RevId: 161785868
* Fix BuildRuleWithDefaultsBuilder to work properly with NODEP_LABEL attributes.Gravatar jcater2017-07-07
| | | | | | | | NODEP_LABEL attributes are not allowed to set file types, but populateLabelAttributes assumes that every label attribute has a file type set. Fix this by adding in better checks. PiperOrigin-RevId: 161212141
* Open source unit tests for the objc rules.Gravatar cpeyser2017-07-06
| | | | PiperOrigin-RevId: 161010594
* Cleanup for Java 8Gravatar laurentlb2017-07-05
| | | | PiperOrigin-RevId: 160832316
* Migrate Java tests to Truth.Gravatar lberki2017-05-30
| | | | | | RELNOTES: None. PiperOrigin-RevId: 157446717
* Expose the target map from Package.Gravatar carmi2017-05-19
| | | | | | | | This doesn't really expose new information, because one can iterate over the existing getTargets() and recreate the map. Moreover, the map is immutable, so there's no risk in returning it to the user. RELNOTES: None PiperOrigin-RevId: 156349797
* PiperOrigin-RevId: 156331430Gravatar nharmata2017-05-19
|
* Automated g4 rollback of commit 9dec9a09d1e4d27e7cff73c440195a32d3b90752.Gravatar plf2017-05-05
| | | | PiperOrigin-RevId: 155194438
* Introduce BazelPackageLoader.Gravatar nharmata2017-05-04
| | | | | | | | | This is a standalone library for loading packages. It is intended to be used by clients outside of Bazel (for now, Kythe). Perform BazelPackageLoader#loadPackage in the testing hook used in all of Bazel's unit tests and integration tests. This gives us very good test coverage for BazelPackageLoader. RELNOTES: None PiperOrigin-RevId: 155004070