Description
As of 6936bd6, tests such as userland/c/file_write_read.c use #define LKMC_TMP_FILE __FILE__ LKMC_TMP_EXT
to select what file they should write to.
__FILE__
expands to the full C soure path, so multiple runs of the same files would write and read to the same output, possibly leading to clashes, e.g.:
./run -aA -u userland/c/file_write_read.c --emulator qemu
generates an in-tree userland/c/file_write_read.c.tmp
. The same applies for gem5.
The only ANSI C standard solution I can see that works for both test-executables-in-tree
(which should output those files in-tree) and test-executables
would be to make all of those tests take a CLI parameter that points to the desired output path to use. We can then make the test system pass unique output path arguments to those programs.
The files should be placed in run/ directories instead.