google / google/compile-testing

generatesSources() requires that expected paths be exact suffixes of generated paths

Open
#39 0 comments 0 reactions 0 assignees View on GitHub
P3 type=enhancement
Dominant language
Java
Stars
722
Forks
129
Avg merge
11m
Merged PRs (30d)
4

Description

The way the `generatesSources()` clause is implemented seems to indicate that it wants to enforce that the paths to expected sources be exact suffixes of the paths in all generated sources. This imposes an inconvenient structure on testing directories.

`ResourceSourceJavaFileObject`s are assigned a URI upon creation that is equal to the resource path. `generatesSources()` has a failure mode which is triggered when `!generatedResourceURI.getPath().endsWith(expectedResourceURI.getPath())`.

This forces users to put the resources that contain expected sources in the target directory for their corresponding generated sources.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.