On Tue, May 07, 2019 at 12:49:18PM +0200, Michal Privoznik wrote:
On 5/7/19 11:13 AM, Daniel P. Berrangé wrote:
> On Mon, May 06, 2019 at 10:01:37AM +0200, Michal Privoznik wrote:
> > There are some scripts/binaries that are not tests themselves but
> > rather fulfill support purpose. Separate them from the rest of
> > the tests.
> >
> > Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
> > ---
> > .gitignore | 2 +-
> > Makefile.am | 2 +-
> > cfg.mk | 4 +-
> > configure.ac | 1 +
> > tests/Makefile.am | 22 +-----
> > tests/qemucapabilitiestest.c | 4 +-
> > tests/testutils.c | 2 +-
> > tests/{ => tools}/.valgrind.supp | 0
> > tests/tools/Makefile.am | 85 +++++++++++++++++++++
> > tests/{ => tools}/check-file-access.pl | 0
> > tests/{ => tools}/file_access_whitelist.txt | 0
> > tests/{ => tools}/group-qemu-caps.pl | 0
> > tests/{ => tools}/oomtrace.pl | 0
> > tests/{ => tools}/qemucapsprobe.c | 0
> > tests/{ => tools}/qemucapsprobemock.c | 0
> > tests/{ => tools}/test-wrap-argv.pl | 2 +-
> > 16 files changed, 98 insertions(+), 26 deletions(-)
> > rename tests/{ => tools}/.valgrind.supp (100%)
> > create mode 100644 tests/tools/Makefile.am
> > rename tests/{ => tools}/check-file-access.pl (100%)
> > rename tests/{ => tools}/file_access_whitelist.txt (100%)
> > rename tests/{ => tools}/group-qemu-caps.pl (100%)
> > rename tests/{ => tools}/oomtrace.pl (100%)
> > rename tests/{ => tools}/qemucapsprobe.c (100%)
> > rename tests/{ => tools}/qemucapsprobemock.c (100%)
> > rename tests/{ => tools}/test-wrap-argv.pl (98%)
>
> If we're going to re-arrange our tests, then I would really like to
> see the goal be to remove the top level "tests/" directory entirely.
>
> Instead move the tests under the src/ sub-directory that corresponds
> to the code being tested. eg we should have src/util/virhashtest.c
> alongside src/util/virhash.c So instead of one giant test dir we
> have everything distributed.
>
> That way if you are running "make" in the src/ directory, you don't
> need to change dir to do tests. It will also let us split up the
> ever growing set of makefile rules for tests.
How is that? Won't we have to have the rules to build tests in
src/Makefile.am?
Most of the rules will be in the many src/*/Makefile.in.am files
Personally, I find having code along side with the tests even more
disaranged than what we have now. For some unit tests we can have strict
naming scheme: virhash.c -> virhashtest.c; but for some more advanced tests
qemuxml2*test this won't work.
We don't need to rename everything - that could be src/qemu/qemuxml2argvtest.c
easily enough
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|