12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- """Build configuration for unit test of minimal library.
- """
- Import('*')
- env.PartName('utest')
- env.DependsOn([Component(env.subst('${PART_PARENT_NAME}'),
- requires=REQ.EXISTS|REQ.DEFAULT),
- Component('gtest'),
- Component('common-testhelper'),
- Component('verifier')])
- utest_files = Pattern(src_dir='.',
- includes=['*-test.cc',
- '*-testhelper.cc'],
- recursive=True).files()
- env.Append(CPPPATH='#')
- env['UNIT_TEST_TARGET_NAME'] = "${PART_PARENT_NAME}-${UNIT_TEST_TARGET}"
- shlib = []
- if 'shared' in env['MODE']:
- if env['TARGET_OS'] == 'win32':
- dependent_shlib = env.subst("${{DEPENDS.{0}.SDKBIN}}"
- .format(env.subst("${PART_PARENT_NAME}")))
- shlib = env.CCopy("${INSTALL_TEST_BIN}", dependent_shlib)
- else:
- dependent_shlib = env.subst("${{DEPENDS.{0}.SDKLIB}}"
- .format(env.subst("${PART_PARENT_NAME}")))
- shlib = env.CCopy("${INSTALL_LIB}", dependent_shlib)
- utest = env.UnitTest('${PART_SHORT_NAME}',
- utest_files,
- command_args=[
- '--gtest_filter=**',
- '--gtest_color=yes',
- '--gtest_print_time=1',
- '--gtest_output=xml',
- #'--gtest_break_on_failure',
- #'--gtest_catch_exceptions=0',
- ],
- data_src=[],
- make_pdb=(env.isConfigBasedOn('debug')),
- INSTALL_BIN='${INSTALL_TEST_BIN}'
- )
- Depends(utest, shlib)
|