Rust-GCC / gccrs

GCC Front-End for Rust
https://rust-gcc.github.io/
GNU General Public License v2.0
2.38k stars 155 forks source link

Test Case Naming Conventions #435

Open philberty opened 3 years ago

philberty commented 3 years ago

At present, I have been creating test cases like generics1,2,3,4 etc, which is not helpful in terms of figuring out what they are testing. It has been ok for now since test cases are small.

Below is a simple naming convention that might help, but I wish to solicit feedback first.

  1. If its a github issue: name the test case issue-number.rs
  2. Else name the test case with language-feature.rs but contain a comment at the start of the test case what this test case covers.
CohenArthur commented 3 years ago

I think it would be useful for issue related files to also contain some sort of naming related to what they contain. This way, it's also easier to run it by itself without necessarily running the whole test suite. Something like <language-feature>#<issue-number>.rs

For example, gcc/testsuite/rust.test/compile/underscore_id.rs would become gcc/testsuite/rust.test/compile/underscore_id#361.rs

Since it's easier to search for underscore in your shell history than 361

bjorn3 commented 3 years ago

Using # is not a good idea I think given it's special meaning in urls and in shells.

dkm commented 3 years ago

I like the idea of having the issue number first in the name, but that maybe biased by my habits in gcc where tests are named pr<number>.c.

mathstuf commented 2 years ago

"pr" is ambiguous here. Maybe to avoid stepping on any existing GCC "pr" number, how about "gh"?