> On Apr 19, 2021, at 7:26 PM, Martin Sebor via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > On 4/19/21 3:13 PM, Koning, Paul wrote: >>> On Apr 19, 2021, at 4:50 PM, Martin Sebor via Gcc-patches >>> <gcc-patches@gcc.gnu.org> wrote: >>> >>> ... >>> I was actually thinking of just #including each foo-tests.c file >>> to bring in the code right where it is now, so this shouldn't be >>> a problem. Would that work for you? >>> >>> Martin >> How does that help the problem you said need to be solved? If having self >> test code be part of the compilation unit makes modifying things more >> difficult, it doesn't matter whether that code is in the compilation unit >> due to being in the main source file, or due to being a #include. > > The self tests make the sources bigger and so harder to move around > in and difficult to find just the calls to tested functions made > from elsewhere in the file or from other parts of the compiler (i.e., > not tests). They are only rarely relevant when reading or changing > the file. > > Keeping them separate from the code they exercise will be helpful > to me and I assumed to others as well. But I wouldn't want to make > some common tasks difficult, so if you or someone else has one that > would be made so by it, I won't pursue it. Do you? No, I don't have objections. For one thing, I don't work on files that have selftest in them at the moment. I was just trying to understand better why using #include would help. I understand your point; I'm not sure I'd feel the same way but I don't see any reason to object to your proposed approach. paul
Re: move selftests into their own files?
Koning, Paul via Gcc-patches Mon, 19 Apr 2021 17:11:58 -0700
- move selftests into their own files? Martin Sebor via Gcc-patches
- Re: move selftests into their own file... David Malcolm via Gcc-patches
- Re: move selftests into their own ... Martin Sebor via Gcc-patches
- Re: move selftests into their ... Koning, Paul via Gcc-patches
- Re: move selftests into th... Martin Sebor via Gcc-patches
- Re: move selftests in... Koning, Paul via Gcc-patches
- Re: move selftests in... Aldy Hernandez via Gcc-patches