verifier.parts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ############################################################################
  2. # Copyright 2016 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################
  16. Import('*')
  17. env.PartName('verifier')
  18. api_headers = Pattern(src_dir='.',
  19. includes=['*.h'],
  20. recursive=False).files()
  21. src_files = Pattern(src_dir='src',
  22. includes=['*.c'],
  23. recursive=False).files()
  24. internal_headers = Pattern(src_dir='src',
  25. includes=['*.h', '*.inc'],
  26. recursive=False).files()
  27. utest_files = Pattern(src_dir='unittests',
  28. includes=['*-test.cc', '*-testhelper.cc'],
  29. recursive=False).files()
  30. utest_headers = Pattern(src_dir='unittests',
  31. includes=['*-testhelper.h',],
  32. recursive=False).files()
  33. utest_data_files = Pattern(src_dir='unittests/testdata/sigrl',
  34. includes=['*.inc'],
  35. excludes=[],
  36. recursive=False).files()
  37. epid11_headers = Pattern(src_dir='1.1',
  38. includes=['*.h'],
  39. recursive=False).files()
  40. epid11_src_files = Pattern(src_dir='1.1/src',
  41. includes=['*.c'],
  42. recursive=False).files()
  43. epid11_internal_headers = Pattern(src_dir='1.1/src',
  44. includes=['*.h', '*.inc'],
  45. recursive=False).files()
  46. epid11_utest_files = Pattern(src_dir='1.1/unittests',
  47. includes=['*-test.cc', '*-testhelper.cc'],
  48. recursive=False).files()
  49. epid11_utest_headers = Pattern(src_dir='1.1/unittests',
  50. includes=['*-testhelper.h',],
  51. recursive=False).files()
  52. epid11_utest_data_files = Pattern(src_dir='1.1/unittests/testdata',
  53. includes=['*.inc'],
  54. recursive=False).files()
  55. build_files = Pattern(src_dir='.',
  56. includes=['*.parts', 'Makefile'],
  57. recursive=False).files()
  58. if 'install_package' in env['MODE']:
  59. env.InstallTopLevel(api_headers,
  60. sub_dir='epid/${PART_SHORT_NAME}')
  61. env.InstallTopLevel(src_files + internal_headers,
  62. sub_dir='epid/${PART_SHORT_NAME}/src')
  63. env.InstallTopLevel(utest_files + utest_headers,
  64. sub_dir='epid/${PART_SHORT_NAME}/unittests')
  65. env.InstallTopLevel(
  66. utest_data_files,
  67. sub_dir='epid/${PART_SHORT_NAME}/unittests/testdata/sigrl')
  68. env.InstallTopLevel(epid11_headers,
  69. sub_dir='epid/${PART_SHORT_NAME}/1.1')
  70. env.InstallTopLevel(epid11_src_files + epid11_internal_headers,
  71. sub_dir='epid/${PART_SHORT_NAME}/1.1/src')
  72. env.InstallTopLevel(epid11_utest_files + epid11_utest_headers,
  73. sub_dir='epid/${PART_SHORT_NAME}/1.1/unittests')
  74. env.InstallTopLevel(
  75. epid11_utest_data_files,
  76. sub_dir='epid/${PART_SHORT_NAME}/1.1/unittests/testdata')
  77. env.InstallTopLevel(build_files, sub_dir='epid/${PART_SHORT_NAME}')
  78. else:
  79. env.DependsOn([
  80. Component('common'),
  81. ])
  82. env.Append(CPPPATH='#')
  83. testenv = env.Clone()
  84. outputs = env.Library('${PART_NAME}', src_files + epid11_src_files)
  85. env.Sdk(outputs)
  86. env.SdkInclude(api_headers, sub_dir='epid/${PART_SHORT_NAME}')
  87. env.SdkInclude(epid11_headers, sub_dir='epid/${PART_SHORT_NAME}/1.1')
  88. if 'install_lib' in env['MODE']:
  89. env.InstallLib(outputs)
  90. env.InstallInclude(api_headers, sub_dir='${PART_SHORT_NAME}')
  91. env.InstallInclude(epid11_headers, sub_dir='${PART_SHORT_NAME}/1.1')
  92. testenv['UNIT_TEST_TARGET_NAME'] = "${PART_NAME}-${UNIT_TEST_TARGET}"
  93. testenv.UnitTest("utest",
  94. utest_files + epid11_utest_files,
  95. command_args=[
  96. '--gtest_color=yes',
  97. '--gtest_print_time=1',
  98. '--gtest_output=xml',
  99. '--gtest_filter=**',
  100. ],
  101. make_pdb=(env.isConfigBasedOn('debug') or
  102. env.isConfigBasedOn('static_crt_debug')),
  103. depends=[Component('gtest'),
  104. Component('common-testhelper'),
  105. Component('verifier')],
  106. INSTALL_BIN='${INSTALL_TEST_BIN}')