Test runner improvements#21708
Conversation
* Add a -cc option to runtests which lets the user specify the path to curl-config. * Move $CURLCONFIG to the global configuration and make it usable in test scripts. * Modify the curl-config test cases (1013, 1014, 1022, 1023) to use %CURLCONFIG instead of a hard-coded path. This is a small step on the way to making the test suite installable.
4d7a143 to
c125e20
Compare
|
|
||
| TESTS_PL = \ | ||
| test307.pl \ | ||
| test610.pl test613.pl \ |
There was a problem hiding this comment.
| test610.pl test613.pl \ | |
| test610.pl \ | |
| test613.pl \ |
maybe put each in its own line? (not likely to have very many of these scripts in the future.
There was a problem hiding this comment.
I was following the established style, which is one line per decade.
There was a problem hiding this comment.
It's the exception, and not really decades everywhere. I think if we change, one per line is easier, also for diffs. It's also very unlikely the number of these scripts grow significantly in the future.
|
|
||
| EXTRA_DIST = CMakeLists.txt $(FIRST_C) $(FIRST_H) $(UTILS_C) $(UTILS_H) $(TESTS_C) \ | ||
| test307.pl test610.pl test613.pl test1013.pl test1022.pl mk-lib1521.pl | ||
| $(TESTS_PL) mk-lib1521.pl |
There was a problem hiding this comment.
What is the advantage of moving this list to Makefile.inc?
There was a problem hiding this comment.
Makefile.inc can be ingested by other scripts or makefiles and now has a complete list of test scripts and programs.
There was a problem hiding this comment.
The only makefile this is ingested in in Makefile.am, thus I don't see a compelling
reason to move this (then it'd also need to be documented in the comment at each
ingestion place, even if not used). It may be split off into its own variable within
Makefile.am, if that helps, but not a big fan of doing that in general.
There was a problem hiding this comment.
edit: if this is meant to support running tests outside of the normal automake/cmake
framework, with 3rd-party tooling I suggest a local solution that doesn't need curl make
changes like this, because things without obvious internal uses are difficult to reason
about and maintain. E.g. a 3rd-party script may find tests/libcurl -name 'test*.pl' and
use that list to figure out test*.pl.
There was a problem hiding this comment.
Adding TESTS_PL makes the libtest build more consistent and maintainable, independently of my out-of-tree use. Currently the Perl test scripts are only listed in EXTRA_DISTS in Makefile.am, which has a very specific meaning; now there is a list of Perl test scripts in Makefile.inc, which is automatically included in EXTRA_DISTS. This means the procedure for adding a Perl test script is now the same as for adding a C test program: add the file, then edit Makefile.inc.
Fwiw, I intend to eventually submit a PR that makes the tests installable, but it's not quite ready yet.
There was a problem hiding this comment.
What this looks like to me is creating a public interface for something that is not meant to be public.
I'm not a fan of this change. It's also unrelated to the other changes in this PR and its goal is also unrelated to anything curl tests need internally.
If it will make sense in context of a future PR I believe it's should be changed and reviewed there.
There was a problem hiding this comment.
Think of it as refactoring. It improves the readability and maintainability of the libtest build.
There was a problem hiding this comment.
Strong disagree. IMO it does the opposite.
|
In what use-case is it useful to override |
I have a client who wants to include the cURL tests in their integration test suite. This means installing the tests and running them without the source tree present and without write access to the directory where the tests are located. With this change I can run |
Add a TESTS_PL variable to tests/libtest/Makefile.inc which lists the handful of library tests that are actually Perl scripts instead of C programs. These were previously only listed in EXTRA_DIST in the Makefile.
c125e20 to
98aa1e4
Compare
I wonder if including this information in the PR text would better explain |
It was mentioned in the commit message. I assumed reviewers read those. |
It doesn't? It says what the commit does, but not the why. |
“This is a small step on the way to making the test suite installable.” |
I mean the PR message, that gets merged, if a PR is accepted. To me though this doesn't explain it, because I don't grok what Adding runtests.pl options that the project itself doesn't use is |
curl-configto be specified on the command line