[Top][All Lists]

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

Re: Running tests as a gnulib developer

From: Eric Blake
Subject: Re: Running tests as a gnulib developer
Date: Tue, 10 Jan 2012 09:51:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

On 01/10/2012 09:30 AM, Reuben Thomas wrote:
> I've just spent a while trying to work out how to run tests for a
> particular module, and I'm not getting very far.
> ./gnulib-tool --help brings up the "--test" mode, which looks
> promising, but if I run
> ./gnulib-tool --test --test-dir=/tmp/testdir copy-file

That says where the test dir should be located, but didn't load any test
modules to actually do the testing.  Personally, I use:

./gnulib-tool --with-tests --test copy-file

which says to include the copy-file-tests module automatically, as well
as running the unit test (and clean it up on success), when developing
on a single machine.  And when trying to test on a machine that can't
run gnulib, but can share an NFS mount with a more powerful machine, I run:

./gnulib-tool --with-tests --create-testdir --dir=/path/to/dir module

on the powerful machine, then on the machine under test,

cd /path/to/dir && ./configure && make check

> ./gnulib-tool --test --test-dir=/tmp/testdir test-copy-file
> Hmm, no such module. A bit of grepping reveals that it's called
> copy-file-tests. Why the inconsistency?

I'm not sure of the historical reasoning.  I guess test modules end in
-test so that they sort near the module they are testing, while the
actual test files start with a prefix of test so that if the tests are
dumped in the same directory as something else, all gnulib unit tests
sort together.  But yeah, I've tripped up on it before, as well.

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]