๐Ÿ“ฆ jieyouxu / structured-compiletest-directives

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching โš–๏ธ Apache License 2.0
๐Ÿ“ฅ Clone https://github.com/jieyouxu/structured-compiletest-directives.git
HTTPS git clone https://github.com/jieyouxu/structured-compiletest-directives.git
SSH git clone git@github.com:jieyouxu/structured-compiletest-directives.git
CLI gh repo clone jieyouxu/structured-compiletest-directives
่ฎธๆฐๅ‹ Jieyou Xu (Joe) ่ฎธๆฐๅ‹ Jieyou Xu (Joe) Add more design considerations dc98bcf 1 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ compiletest
๐Ÿ“ compiletest_cli
๐Ÿ“ example_tests
๐Ÿ“„ .gitignore
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ rustfmt.toml
๐Ÿ“„ README.md

Structured compiletest directives experiment

Current compiletest directives are rather unstructured, the syntax is unclear, error messages are poor if they exist, and makes parsing and handling very complicated in compiletest. In this repo, we experiment with a structured TOML test metadata approach as proposed by Chris in .

This is merely for demonstration and exploration purposes, if we want to actually make this change to compiletest we'll need both a MCP as well as a solid migration plan for //@-style directives to the structured TOML directives.

Example

Before:

//@ run-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[current] compile-flags: -C opt-level=0
//@[next] compile-flags: -Znext-solver -C opt-level=0

After:

%%CODEBLOCK1%%compiletest //! mode = "run-pass" //! revisions = ["current", "next"] //! //! [[ignore]] //! compare-mode = "next-solver" //! reason = "explicit revisions" //! //! # default solver //! [revision."current"] //! compile-flags = ["-C opt-level=0"] //! //! # next solver //! [revision."next"] //! compile-flags = ["-Znext-solver", "-C opt-level=0"] //! %%CODEBLOCK2%%