[Bash-completion-devel] file inclusions in test suite

Guillaume Rousse Guillaume.Rousse at inria.fr
Sun Jan 31 21:29:27 UTC 2010


Le 04/01/2010 20:49, Freddy Vulto a écrit :
> On 100103 13:23, Guillaume Rousse wrote:
>> I recently commited autotools-integration of test suite. It works, but
>> only in classical usage scenarion, meaning running ./configure inside
>> the source directory. Using vbuild (running configure from another
>> directory), as in the 'make distcheck' scenario, doesn't work, because
>> all inclusions path are relative to current working directory.
>>
>> For instance, file 'completion/ssh.exp' include
>> 'lib/completions/ssh.exp'. If you're executing the test from anywhere
>> else as 'test' directory, it does't work.
>>
>> test
>> ├── completion
>> │   └── ssh.exp
>> └── lib
>>      └── completions
>>          └── ssh.exp
>>
>> Is there a way to make those inclusions relative to either including
>> file location, or to a variable sourcedir instead ?
>
> I've looked in DejaGnu's `runtest' and saw they're their own method called
> `load_file' instead of `source'.  Maybe we can use this as well:
>
>     load_file $libdir/completions/ssh.exp
>
> But how are the tests executed from within autotools, via runtest,
> runCompletion or run, and can't these be made to do a change dir to the `test'
> directory before executing tests?
I don't think it is possible to interfere with the ways makefiles 
generated from automake run tests, unless by overriding builtin rules, 
which I'd rather avoid. And this would break v-build feature (multiple 
build trees for a single source tree), anyway.

> Anyway, no objections to replace `source ..'
> with `load_file $libdir/..' if this makes autotools work.
OK, I'll try this.

> And - forgive me if a dumb question - what's the benefit/typical-usage, once
> having autotools-integration of the test suite?
I see two advantages of integrating tests:
- using a standard testing command (make check) instead of custom ones 
(cd test && ./runCompletion && ./runInstall && ./runUnit)
- running tests from the distributed content (through make distcheck) 
rather than from the developper working directory. It protects against 
missing files in the tarball.

>> Also, why do we need to move actual completion test to
>> lib/completion/ssh.exp, instead of leaving it in completion/ssh.exp ?
>> I've had a quick look, it doesn't seems to be included from anywhere else.
>
> The separation originates from bash-completion-lib where completions are tested
> twice; once before dynamic loading and a second time after: it proved to be
> useful to have the completions in a separate file so the completions can be
> tested twice easily.
[..]
Thanks. This explanation should be present in doc/testing.txt
-- 
BOFH excuse #126:

it has Intel Inside



More information about the Bash-completion-devel mailing list