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
This project is the follow-up of the previous Google Summer of Code project [Improving user errors & Error Code Support for GCC Rust Frontend](https://summerofcode.withgoogle.com/archive/2023/projects/PZbjvfZl). We have to adapt a copy of the rustc testsuite to make use of the error code framework implemented in gccrs as part of GSoC 2023. We need to develop a test case runner similar to rustc's one, in order to match error codes and line numbers to the output of gccrs. Specifically, we need to ensure that gccrs is emitting the correct error code consistent with rustc-1.49. This project requires investigating the current test framework of gcc/gccrs (dejagnu) and also the official rustc one.
30
+
This project is the follow-up of the previous Google Summer of Code project [Improving user errors & Error Code Support for GCC Rust Frontend](https://summerofcode.withgoogle.com/archive/2023/projects/PZbjvfZl). We have to adapt a copy of the rustc testsuite to make use of the error code framework implemented in gccrs as part of GSoC 2023. We need to develop a test case runner similar to rustc's one, in order to match error codes and line numbers to the output of gccrs. Specifically, we need to ensure that gccrs is emitting the correct error code consistent with rustc-1.49. This project requires investigating the current test framework of gcc/gccrs (dejagnu) and also the official rustc one.
29
31
The main exact goal of this project is to have access to a tool which enables us to run gccrs on the rustc test cases and assert that we emit the correct error codes/messages w.r.t to their line numbers. Furthermore, the extended deliverable of this project is to integrate this tool in gccrs CI/CD pipeline.
30
32
31
33
## What was Done:
32
34
33
35
- Researched the Rust testing framework "[compiletest](https://rustc-dev-guide.rust-lang.org/tests/compiletest.html)" to understand how test cases are organized and Rust processes and executes test cases.
34
36
- Learned "Rust" programming language and created a new tool, named [rusttest-to-dg](github.com/Rust-GCC/rusttest-to-dg) to convert the Rust test cases to DejaGnu format.
35
37
38
+
For gccrs, we only want to check the [ui](https://rustc-dev-guide.rust-lang.org/tests/ui.html) tests — these tests are a collection of general-purpose tests which primarily focus on validating the console output of the compiler.
39
+
40
+
The general structure of rustc test cases consists of a Rust source file located anywhere in the "tests/ui" directory. For example, [tests/ui/hello.rs](https://github.com/rust-lang/rust/blob/master/tests/ui/hello.rs) is a basic hello-world test. The rust compiler uses a tool called "compiletest" which will test, and compare the compiler output against the expected output which is stored in a .stdout or .stderr file located next to the test. See [output comparison](https://rustc-dev-guide.rust-lang.org/tests/ui.html#output-comparison) for more details.
41
+
42
+
The errors and warnings in the rust test cases was annotated with comments within the source file.
43
+
44
+
For explaning, let's take a random [example](https://github.com/rust-lang/rust/blob/master/tests/ui/associated-item/ambiguous-associated-type-with-generics.rs) of a Rust test case:
45
+
46
+
```rust
47
+
traitTrait<A> {}
48
+
49
+
traitAssoc {
50
+
typeTy;
51
+
}
52
+
53
+
impl<A> AssocfordynTrait<A> {
54
+
typeTy=i32;
55
+
}
56
+
57
+
fnmain() {
58
+
let_x: <dynTrait<i32>>::Ty; //~ ERROR ambiguous associated type
Note that, we are only adding error codes, not the error messages. We are not comparing error messages, as gccrs and rustc error messages differs in grammatical terms but have same context. We are just making sure, that gccrs and rustc emits same rustc error codes. Therefore, as long as the error code is correct, the regex pattern in [dg-error](https://gcc.gnu.org/onlinedocs/gccint/testsuites/directives-used-within-dejagnu-tests/syntax-and-descriptions-of-test-directives.html#verify-compiler-messages) will pass.
115
+
36
116
## Contributions Overview:
117
+
37
118
### Pull Requests:
119
+
38
120
For a comprehensive overview of the pull requests I've submitted, visit [pull requests page](https://mahadmuhammad.github.io/gsoc/24/r/pulls/).
39
121
40
122
### Issues:
123
+
41
124
To delve deeper into the intricacies of the issues I've engaged with, feel free to explore the dedicated [issue page](https://mahadmuhammad.github.io/gsoc/24/r/issues/).
42
125
43
126
## Work for the future:
@@ -55,6 +138,7 @@ To delve deeper into the intricacies of the issues I've engaged with, feel free
55
138
56
139
## Acknowledgements:
57
140
58
-
I am very grateful to the following people who made this project possible and supported me throughout the process. Their expertise, feedback and encouragement were invaluable for me.
141
+
I am very grateful to the following people who made this project possible and supported me throughout the process. Their expertise, feedback and encouragement were invaluable for me.
142
+
59
143
-[Arthur Cohen](https://github.com/cohenarthur/),[Pierre Emmanuel Patry](https://github.com/P-E-P/) and [Thomas Schwinge](https://github.com/tschwinge) for being my amazing mentors and guiding me with their insights and experience.
60
-
- And last but not least, [Philip Herron](https://github.com/philberty/) and [Faisal Abbas](https://github.com/abbasfaisal/) for assisting me in my initial contributions.
144
+
- And last but not least, [Philip Herron](https://github.com/philberty/) and [Faisal Abbas](https://github.com/abbasfaisal/) for assisting me in my initial contributions.
0 commit comments