ATF-devel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Running tests with different path for Kyuafiles and binaries ?


On 06/08/2012 04:34 PM, Julio Merino wrote:

Unfortunately, this is trickier than it should be.  You can take a
look at how the kyua-cli package jumps through the necessary hooks to
get this working... but it's not pretty.  Basically, there is a script
to populate the build tree with copies of the Kyuafiles, just as if
they were products of the build.  It works, but it's extra complex.

Okay, I will take a peek at the build system of kyua-cli and mimic it (as a temporary solution).

Ideas on how to simplify this would certainly be welcome.

Well, for me, it would be extremely convenient to have something similar to `--kyuafile=path' which will let the user specify where to find the rootdir of the built binaries.

Something like:

kyua --kyuafile=kyuafile_rootdir --bindir=bin_rootdir

Of course, both must have the exact same structure.

I am already running 'kyua test --kyuafile=$(top_srcdir)' from my Makefile
in order to find the Kyuafiles. But, it breaks when I am specifying:

At the moment, the *_test_program definitions restrict the test
programs to live in the same directory as the Kyuafile that references
them; passing paths will not work.  I'm not convinced this is the most
reasonable solution, but I like its simplicity.

Having Kyuafiles pointing at arbitrary directories could make things
more confusing.  For example, how do you identify the test programs
within that Kyuafile?  By their basename?

More precisely by their rootdir. You only need to keep in mind two rootdirs: Kyuafile_rootdir and bin_rootdir. Both should have the same underlying structure.

 Or should there be an
additional "binary" attribute to the test program that can be a path,
and "name" is just the identifier?  How are these represented for
historical purposes in the database?

I do not get the problem here. You just want to distinguish the location of the two rootdirs, nothing more. So, the impact will only be on the 'kyua test' subcommand and will leave the rest exactly the same (at least, I think it should be).

Another possibility that just crossed my mind (and that I think makes
a lot of sense atually) would be to teach "kyua test" about build
directories: allow the caller to specify a destdir/buildroot and use
that as the prefix to locate the binaries themselves (not the
Kyuafiles).  This would be more in line with make's behavior and some
other build tools I have used.  The issue here would be dealing with
programs that reference data files in the program's srcdir: if the
data file needs some kind of "build", then it will be in the
buildroot; otherwise, it will be in the source tree.  But we could
deal with that somehow!

Yes, this is what I would go for. :)

What do you think?

Last solution would be extremely nice (and match exactly my expectation for doing this job).

Emmanuel Fleury

Rule of Simplicity: Design for simplicity; add complexity only where
you must.
  -- Eric S. Raymond (The Art of Unix Programming)

Home | Main Index | Thread Index | Old Index