You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if you specify a template, e.g. with
env['CXXTEST_OPTS'] = '--template=' + Dir('.').srcnode().abspath + '/src/tests/mpirunner.tpl'
and then use multiple test suites, e.g.
env.CxxTest(target='#/build/parallel_test_suite',source=['test1.t.h' ,'test2.t.h'])
the linker will fail because mutiple main() are defined.
The reason for this lies in lines 374-379 in build_tools/SCons/cxxtest.py:
deps.append(env.CxxTestCpp(headers.pop(0), *_kwargs))
deps.extend(
[env.CxxTestCpp(header, CXXTEST_RUNNER = 'none',
CXXTEST_ROOT_PART = '--part', *_kwargs)
for header in headers]
)
The "second" test suite gets the option cxxtest_runner='none' which prevents the generation of another main. If you use a template, however, cxxtest_runner has no effect and a main will be generated according to the template.
We fixed this in our project by adding CXXTEST_OPTS = ''. However, a better solution would be to filter --template from CXXTEST_OPTS and add CXXTEST_OPTS = filteredOpts.
The text was updated successfully, but these errors were encountered:
Hi,
if you specify a template, e.g. with
env['CXXTEST_OPTS'] = '--template=' + Dir('.').srcnode().abspath + '/src/tests/mpirunner.tpl'
and then use multiple test suites, e.g.
env.CxxTest(target='#/build/parallel_test_suite',source=['test1.t.h' ,'test2.t.h'])
the linker will fail because mutiple main() are defined.
The reason for this lies in lines 374-379 in build_tools/SCons/cxxtest.py:
deps.append(env.CxxTestCpp(headers.pop(0), *_kwargs))
deps.extend(
[env.CxxTestCpp(header, CXXTEST_RUNNER = 'none',
CXXTEST_ROOT_PART = '--part', *_kwargs)
for header in headers]
)
The "second" test suite gets the option cxxtest_runner='none' which prevents the generation of another main. If you use a template, however, cxxtest_runner has no effect and a main will be generated according to the template.
We fixed this in our project by adding CXXTEST_OPTS = ''. However, a better solution would be to filter --template from CXXTEST_OPTS and add CXXTEST_OPTS = filteredOpts.
The text was updated successfully, but these errors were encountered: