Skip to content

Conversation

@mloskot
Copy link
Member

@mloskot mloskot commented Oct 28, 2018

Add Boost.Jam rule generating test target for each header found in specified location.
List test suites (target aliases) for groups of headers.
Build self_contained_headers test only if CI environment variable is NOT defined or on-demand, if TEST_HEADERS environment variable is defined, or if b2 test/self_contained_headers is requested from command line.

Related to issue #523


First, this PR does not attempt to fix any headers, not yet.

I've run all the headers tests on 24 CPUs (48 logical cores) as follows:

cd libs/geometry
b2 -j 16 test/self_contained_headers >build.log 2>&1

AFAICT, it compile-tests ~900 headers in less than 4 minutes:

cat build.log | grep -E -o "c\+\+.+\~hpp\.test" | sort | uniq | wc -l
898
cat build.log | grep -E -o "passed.+~hpp\.test" | wc -l
547
cat build.log | grep -E -o "failed.+~hpp\.test" | wc -l
350

And, I have only included several extensions, see alias-es and comments in test/self_contained_headers/Jamfile.


To run the tests on CI services, it should be enough to define environment variable TEST_HEADERS=1 for one just build job. For example, Boost.GIL defines it for first job only https://travis-ci.org/boostorg/gil/jobs/447353675

Add Boost.Jam rule generating test target for each header found
in specified location.
List test suites (target aliases) for groups of headers.
Build self_contained_headers test only if CI environment variable is NOT
defined or on-demand, if TEST_HEADERS environment variable is defined,
or if b2 test/self_contained_headers is requested from command line.

Related to issue boostorg#523
@vissarion
Copy link
Member

Thanks, this is useful.

@mloskot
Copy link
Member Author

mloskot commented Oct 30, 2018

Thanks!

@awulkiew
Copy link
Member

awulkiew commented Nov 14, 2018

Wow, thanks! Just to be sure, does it work with CircleCI? (EDIT: And by "it" I mean bjam properly defining CI env ;)).

@mloskot
Copy link
Member Author

mloskot commented Nov 14, 2018

I see no reason why it should not work on CircleCI - I mean, those tests should be automatically filtered there as on Travis or AppVeyor.

CircleCI does define CI as built-in environment variable and b2 just reads the environment variables (no CI needs to be defined in any Jamfile).

@awulkiew
Copy link
Member

Ok, thanks for the explanation.

@awulkiew awulkiew added the tests label Nov 15, 2018
@awulkiew awulkiew added this to the 1.69 milestone Nov 15, 2018
@awulkiew awulkiew merged commit 1998db0 into boostorg:develop Nov 15, 2018
@mloskot mloskot deleted the ml/add-test-for-self-contained-headers branch November 16, 2018 15:58
@awulkiew
Copy link
Member

awulkiew commented Nov 21, 2018

@mloskot This change polluted our regression matrix (https://www.boost.org/development/tests/develop/developer/geometry.html). I'm considering disabling it by default. Or maybe do you have some other ideas?

EDIT: Furthermore on windows the generated paths are too long even with --abbreviate-paths

mloskot added a commit to mloskot/geometry that referenced this pull request Nov 21, 2018
Disable headers tests on CI services and during regression tests.
Refines boostorg#525
@mloskot
Copy link
Member Author

mloskot commented Nov 21, 2018

@awulkiew I'm trying to make those tests on-demand only in #529

I'm not sure how to avoid the long paths. Since the .cpp file is generated, I assumed that is not an issue, so ignored it.

@awulkiew
Copy link
Member

If they are not run by default it is no longer an issue since we can just run them on linux. Thanks!

mloskot added a commit to mloskot/geometry that referenced this pull request Nov 21, 2018
Disable headers tests on CI services and during regression tests.
Refines boostorg#525
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants