On Mon, May 05, 2025, Vipin Sharma wrote: > On 2025-04-30 10:01:29, Sean Christopherson wrote: > > But, I do think we should commit the default.test files to the repository. If > > they're ephemeral, then several problems arise: > > > > 1. For out-of-tree builds, the default.test files should arguably be placed in > > the OUTPUT directory. But if/when we add curated testcases/, then we'll either > > end up with multiple testcases/ directories (source and output), or we'll have > > to copy testcases/ from the source to the output on a normal build, which is > > rather gross. Or we'd need e.g. "make testcases", which is also gross, e.g. > > I don't want to have to run yet more commands just to execute tests. > > > > 2. Generating default.test could overwrite a user-defined file. That's firmly > > a user error, but at least if they default.test files are commited, the user > > will get a hint or three that they're doing things wrong. > > > > 3. If the files aren't committed, then they probably should removed on "clean", > > which isn't the end of the world since they're trivially easy to generate, > > but it's kinda funky. > > > > So, what if we add this to auto-generate the files? It's obviously wasteful since > > the files will exist 99.9999999% of the time, but the overhead is completely > > negligible. The only concern I have is if this will do the wrong thing for some > > build environments, i.e. shove the files in the wrong location. > > We can get the current path of the Makefile.kvm by writing this at the top > of the Makefile.kvm: > MAKEFILE_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) > > Then MAKEFILE_DIR will have the source directory of Makfile.kvm and > testcase will be in the same directory. > > With this we can modify the below foreach you wrote by prefixing > MAKEFILE_DIR to "testcases". > > Does this alleviate concern regaring build environment? Yeah, I think so. FWIW, "concern" probably isn't the right word, more like "the only thing I haven't thought much about".