You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of copy-pasting little bits of the Core package into individual test files, we would like no_prelude tests to be able to opt into specifying a specific minimal prelude file. Then we can still have a minimal set of things getting run through check/ during a test, which is useful for interactive debugging, but we have to maintain a smaller set of minimal preludes instead of it being in so many test files.
…imal prelude library (#5080)
The INCLUDE-FILE option is only used in the toolchain tests for now. If
specified in a file test, the given file path is added to the test's
arguments. For toolchain tests this makes the file's package available
to the test. The `--custom-core` command line flag is added to the
driver, which avoids adding the production `Core` package to the command
line. Together, these allow a test to provide their own minimal `Core`
package.
For example, this would replace `Core` with the package and prelude in
`facet_types.carbon`.
```
// INCLUDE-FILE: toolchain/testing/min_prelude/facet_types.carbon
// EXTRA-ARGS: --custom-core
```
To support this:
* //testing knows how to parse INCLUDE-FILE out of the header of a test
file.
* //testing adds the file to the virtual file system, and includes it in
the test's arguments.
* //toolchain/driver grows the --custom-core command line flag to avoid
loading the production `Core` package.
Tests that were creating their own minimal prelude to define BitAnd on
types are now pointed to
toolchain/testing/min_prelude/facet_types.carbon as the prelude. They no
longer need to `import Core` in each test as a result.
Such tests are no longer `no_prelude`, but instead have their own
prelude. So they are moved to a `min_prelude` subdirectory.
Closes#5076
Description of the bug:
Instead of copy-pasting little bits of the
Core
package into individual test files, we would like no_prelude tests to be able to opt into specifying a specific minimal prelude file. Then we can still have a minimal set of things getting run throughcheck/
during a test, which is useful for interactive debugging, but we have to maintain a smaller set of minimal preludes instead of it being in so many test files.This was discussed in toolchain meeting on March 4, 2025: https://docs.google.com/document/d/1Iut5f2TQBrtBNIduF4vJYOKfw7MbS8xH_J01_Q4e6Rk/edit?resourcekey=0-mc_vh5UzrzXfU4kO-3tOjA&tab=t.0#heading=h.7bhlbi66d40s
The text was updated successfully, but these errors were encountered: