[build][testing] Auto-generated tests not present in reports
Hi, Recently I added auto-generation of compile tests which basically check that every Boost.Log public header is self-contained (i.e. can be included on its own, does not have any missing includes etc.) This is done in the test/Jamfile.v2 as follows: rule test_all { local all_rules = ; local file ; local headers_path = [ path.make $(BOOST_ROOT)/libs/log/include/boost/log ] ; for file in [ path.glob-tree $(headers_path) : *.hpp ] { local rel_file = [ path.relative-to $(headers_path) $(file) ] ; if ! [ MATCH "detail/(.*)" : $(rel_file) ] { #ECHO $(rel_file) ; all_rules += [ compile compile/self_contained_header.cpp : <define>"BOOST_LOG_TEST_HEADER=$(rel_file)" : self_contained_header/$(rel_file) ] ; } } ... other test targets are also generated here return $(all_rules) ; } This rule also generates targets for other tests, including compile tests. It works locally, I can see the generated tests for all headers being compiled. However, I made this change quite some time ago but still I don't see these tests in the test reports table. I can see other tests which are generated by the same test_all rule, so it works. What could be the problem? Any ideas? Thanks.
AMDG On 03/24/2014 09:16 AM, Andrey Semashev wrote:
<snip> all_rules += [ compile compile/self_contained_header.cpp : <define>"BOOST_LOG_TEST_HEADER=$(rel_file)" : self_contained_header/$(rel_file) ] ; <snip>
It works locally, I can see the generated tests for all headers being compiled. However, I made this change quite some time ago but still I don't see these tests in the test reports table. I can see other tests which are generated by the same test_all rule, so it works. What could be the problem? Any ideas?
I suspect that the extra nesting is confusing the test scripts. If that's the case, it will probably work if you avoid using '/' in the test name. In Christ, Steven Watanabe
On Mon, Mar 24, 2014 at 8:44 PM, Steven Watanabe
AMDG
On 03/24/2014 09:16 AM, Andrey Semashev wrote:
<snip> all_rules += [ compile compile/self_contained_header.cpp : <define>"BOOST_LOG_TEST_HEADER=$(rel_file)" : self_contained_header/$(rel_file) ] ; <snip>
It works locally, I can see the generated tests for all headers being compiled. However, I made this change quite some time ago but still I don't see these tests in the test reports table. I can see other tests which are generated by the same test_all rule, so it works. What could be the problem? Any ideas?
I suspect that the extra nesting is confusing the test scripts. If that's the case, it will probably work if you avoid using '/' in the test name.
The problem is the headers are in multiple subfolders inside boost/log, so if I remove the directory, name clashes will appear. For instance, there are boost/log/core/record.hpp and boost/log/expressions/record.hpp. I could try replacing '/' with some other delimiter. Any suggestions on a safe replacement candidate? Also, another idea. Is it possible that $(BOOST_ROOT) is not defined by testers? If so, is there a bullet proof way to know the root of Boost checkout or my library?
AMDG On 03/24/2014 11:17 AM, Andrey Semashev wrote:
The problem is the headers are in multiple subfolders inside boost/log, so if I remove the directory, name clashes will appear. For instance, there are boost/log/core/record.hpp and boost/log/expressions/record.hpp.
I could try replacing '/' with some other delimiter. Any suggestions on a safe replacement candidate?
I believe I used "_". I remember this generates a couple conflicts if you try to use it on the entire Boost tree, though. My code for this is in libs/units/test_headers/Jamfile.v2. Note that I never tried to include this in the regression tests.
Also, another idea. Is it possible that $(BOOST_ROOT) is not defined by testers? If so, is there a bullet proof way to know the root of Boost checkout or my library?
BOOST_ROOT is defined by Jamroot and is inherited by all projects in the Boost tree. It will be defined. You could also use path-constant here : . ; which gives you the directory of the Jamfile. In Christ, Steven Watanabe
participants (2)
-
Andrey Semashev
-
Steven Watanabe