-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polish
glob_lit_tests()
macro and related code.
Add a rule to provide the test file path and the data dependencies of a lit test. Doing this in a rule allows other inputs than simple globs and simplifies path handling. Lit has a peculiar way to discover config and test files from the input arguments. In it's simplest form, lit finds the config files in a parent directory of each input argument (relative to the current directory). It then uses the config directory to execute the RUN commands in the test file at the remainder of the path. If the config files are in a parent directory of the test files, it is therefore sufficient to simply pass the test file paths as input arguments. The config files may override the execution directory by specifying a config.test_exec_root, and the base path of the test files by specifying a config.test_source_root. Each test is executed in the directory of the test file (specified relative to config.test_source_root) relative to the config.test_exec_root directory. We use this to handle the case where the suite is not in a parent directory of the test file. The input path is set to '<suite path>/<test file basename>', and the config.test_source_root is set to the directory of the 'TEST_BINARY' environment variable that bazel provides. The config.test_exec_root is simply set to ".", i.e. use the standard bazel execroot. PiperOrigin-RevId: 407648413
- Loading branch information
1 parent
ad09d37
commit 239505b
Showing
4 changed files
with
126 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.