# GSoC syncup: rustc testsuite adaptor
Rolling agenda.
[Proposal](https://docs.google.com/document/d/11BrjJqBN9erTM61df_Zp5kStzfEPAPawOejTc9jv2H8/edit#heading=h.x9snb54sjlu9)
Upcoming absences:
- Pierre-Emmanuel: 2024-06-24
- Thomas: 2024-08-14/26
## Goals
- have a properly integrated rustc testsuite to test the compiler
- Tools and scripts(rust, etc) should be reusable for testing future versions.
## 2024-08-27
- @Mahad to work on additional header options.
- @Mahad to raise the PR with rust 1.49.0 test cases.
## 2024-08-20
- tool is almost completed
- now we have to run it on the entire testsuite
- whip up a script to do that
## 2024-08-12
- there are sometimes uncomplete error messages in Rustc testcases
- Goal is to complete the tool ASAP and run it on the entire testsuite to find issues
- Add more complex options like target options once the project is finished
__Actions__:
Arthur to review PRs on rusttest-to-dg
## 2024-08-05
https://github.com/Rust-GCC/rusttest-to-dg/issues/9
## 2024-07-29
- https://rustc-dev-guide.rust-lang.org/tests/headers.html
- https://github.com/rust-lang/rust/blob/master/src/tools/compiletest/src/command-list.rs
__Actions__:
- @Mahad need to work on adding compatible `additional optional` from rustc testsuite
- @Mahad need to add error codes along the way
## 2024-07-22
- We need to remove the error message when translating from `// ERROR` to `// { dg-error `
__Actions__:
Arthur, PE and Thomas to review https://github.com/Rust-GCC/rusttest-to-dg/pull/6
## 2024-07-15
- Generate empty dg-error assertions in order to not rely on gccrs error messages being the same as rustc's
- Start looking at error code extraction/parsing from .stderr files, in a separate PR
## 2024-07-08
- https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html
- Run clippy on the codebase: https://doc.rust-lang.org/stable/clippy/usage.html
- Fix comments on the PR and we can merge it :)
- Is there always an .stderr file alongside the .rs file?
- the answer is no
- `<tool> -f whatever.rs` -> `<tool> -f whatever.rs --stderr whatever.stderr`
- https://github.com/Rust-GCC/gccrs/blob/master/gcc/testsuite/rust/compile/xfail/lifetime_param.rs
- https://gcc.gnu.org/onlinedocs/gccint/testsuites/directives-used-within-dejagnu-tests/syntax-and-descriptions-of-test-directives.html
- https://gcc.gnu.org/onlinedocs/gccint/Directives.html
- Don't forget to add `--crate-type=bin --edition=2018` flags on godbolt when using that edition.
__Actions__:
* Mahad to fix comments on PR #1
* Mahad to create second PR with an extra `--stderr <file>` argument
* Mahad to create third PR with empty `dg-error` messages instead of reusing rustc's error message
* Mahad to start investigating the extraction of error codes from `.stderr` files
## 2024-07-01
- Continue with standard [12 Week](https://developers.google.com/open-source/gsoc/help/project-dates?hl=en#12_week_this_is_the_default_for_the_medium_and_large_and_longest_length_allowed_for_small_projects) GSoC project schedule, or wish to extend?
- Standard 12 week is fine.
- for matching error codes, simply put the error code in the dg-error directive
- something like `// { dg-error "E0408" "" { target *-*-* } .-1 }`
- Let's try and get a basic program working for next week
- Simple `//~` to `// dg-error` conversion
- Reuse error codes when they are present, empty error messages otherwise
## 2024-06-24
- We are not running out of time, there's 3 weeks to the midterm eval
- https://github.com/rust-lang/rust/blob/master/tests/ui/anon-params/anon-params-denied-2018.rs
- Take this file, and output an equivalent Rust file with dejagnu directives instead of ERROR directives
- `<tool> <file_to_convert.rs> > gcc/testsuite/rust/<whatever.rs>`
- Build list of things to translate to dejagnu directives:
- `ERROR`
- `//~^`, `//~|`, `//~`
- `@edition:2018`
- First step would be to have a tool that translates `//~ ERROR` to `// dg-error`
- Repo link: https://github.com/Rust-GCC/rusttest-to-dg
## 2024-06-10
- Skip next week meeting
- Mahad exams this week again
- Goals for midterm evaluation
- Having a prototype of the tool
- Have a good grasp on what is needed to do
- Have a good understanding of the Rust language to enable Mahad to contribute to the tool
## 2024-05-31
- review [Actions](#2024-05-22)
- Learning Rust? Mahad has started learning at night, but not agressively learning yet
- Suggestions from Thomas regarding the proposal:
- What to take from .stderr files? Error code + line/column information?
- What to take from inline ERROR directives
- Investigate when one is used over the other?
- Example: https://github.com/rust-lang/rust/tree/master/tests/ui/anon-params
- Where can we find the error code? .stderr file or inline directive?
__Actions__:
@Mahad to research differences between .stderr files and inline directives in rustc testsuite. Where can we get the most useful info? (error code, line/columnn).
@Mahad to raise PR on GitHub of manually converting rustc directive into dejagnu directive (for intution purposes)
@Mahad to keep learning Rust :)
@Mahad to take rustc testcase and manually convert it to expected dejagnu testcase
## 2024-05-22
- review [Actions](#2024-05-13)
- Not much done since Mahad was really busy
- We won’t have a 100% success rate at the beginning of the testsuite integration. Two possibilities
- Add working testcases one by one to the CI/main testsuite
- Mark non-working testcases as expected fail
- Discuss the design of the adaptor, so that it takes a rustc testcase, parses it, transforms the error assertion into a dejagnu error *code* assertion
- Review x-fail (expected to fail) testcases often
- Open issue for each x-fail testcase so that it gets moved to a non x-fail testcase when we fix said issue
__Actions__:
Mahad to start learning Rust: Rustbook and rustlings exercises.
* https://doc.rust-lang.org/book/ch00-00-introduction.html
* https://github.com/rust-lang/rustlings/
* "Comprehensive Rust" resource: https://google.github.io/comprehensive-rust/
Arthur to send calendar invite to Thomas
Arthur to start working on design for adaptor
## 2024-05-13
- what solution to go for? dejagnu or new tool?
- if new tool, written in Rust, which Mahad will have to learn
- exams between 20th of May and 8th of June
__Actions__:
@Mahad to come up with pros/cons list for multiple ideas, how to go about it, some research on the subject for mentors and mentee to discuss.