Reuben Thomas
2012-01-10 16:30:30 UTC
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
then that only seems to build copy-file, not run its tests. So I build
the gnulib manual and poke about, and find the section "Unit test
modules". So now I know there's likely to be a test module (I've
already found the test code under lib/). So, I try
./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?
So, I run
./gnulib-tool --test --test-dir=/tmp/testdir copy-file-tests
Great, this…oh wait, it just builds the tests, but doesn't run them.
Is it just me, or should this be easier? Suggestions as to how I
actually build and run the tests are welcome. (Yes, I found
--with-tests for getting tests included in a project, but I'm trying
to work on gnulib itself, not use it in a project here.)
Oh wait…
./gnulib-tool --test --dir=/tmp/testdir --with-tests copy-file-tests
seems to do what I want! Still, this is not exactly obvious.
I understand that the documentation is more aimed at gnulib users than
gnulib developers, and this is easy enough after all, but some sort of
hint that --test does not actually run unit tests, in order to justify
the seemingly rather goofy "--test --with-tests" (as if I could have
"--test --without-tests"??) would be nice.
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
then that only seems to build copy-file, not run its tests. So I build
the gnulib manual and poke about, and find the section "Unit test
modules". So now I know there's likely to be a test module (I've
already found the test code under lib/). So, I try
./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?
So, I run
./gnulib-tool --test --test-dir=/tmp/testdir copy-file-tests
Great, this…oh wait, it just builds the tests, but doesn't run them.
Is it just me, or should this be easier? Suggestions as to how I
actually build and run the tests are welcome. (Yes, I found
--with-tests for getting tests included in a project, but I'm trying
to work on gnulib itself, not use it in a project here.)
Oh wait…
./gnulib-tool --test --dir=/tmp/testdir --with-tests copy-file-tests
seems to do what I want! Still, this is not exactly obvious.
I understand that the documentation is more aimed at gnulib users than
gnulib developers, and this is easy enough after all, but some sort of
hint that --test does not actually run unit tests, in order to justify
the seemingly rather goofy "--test --with-tests" (as if I could have
"--test --without-tests"??) would be nice.
--
http://rrt.sc3d.org
http://rrt.sc3d.org