Browse Source

Fix generate_build_files.py to account for crypto/test.

crypto/test contains not tests, but a test support library that should be
linked into each test.

Change-Id: If1c85eda2a3df1717edd38575e1ec792323c400b
Reviewed-on: https://boringssl-review.googlesource.com/4720
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 9 years ago
committed by Adam Langley
parent
commit
2607383e72
1 changed files with 18 additions and 4 deletions
  1. +18
    -4
      util/generate_build_files.py

+ 18
- 4
util/generate_build_files.py View File

@@ -90,6 +90,7 @@ class Chromium(object):
],
'sources': [
'%s',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
@@ -99,9 +100,12 @@ class Chromium(object):

test_names.sort()

test_gypi.write(""" ],
'variables': {
'boringssl_test_targets': [\n""")
test_gypi.write(' ],\n \'variables\': {\n')

self.PrintVariableSection(
test_gypi, 'boringssl_test_support_sources', files['test_support'])

test_gypi.write(' \'boringssl_test_targets\': [\n')

for test in test_names:
test_gypi.write(""" '%s',\n""" % test)
@@ -174,10 +178,16 @@ def OnlyTests(dent, is_dir):
"""Filter function that can be passed to FindCFiles in order to remove
non-test sources."""
if is_dir:
return True
return dent != 'test'
return '_test.' in dent or dent.startswith('example_')


def AllFiles(dent, is_dir):
"""Filter function that can be passed to FindCFiles in order to include all
sources."""
return True


def FindCFiles(directory, filter_func):
"""Recurses through directory and returns a list of paths to all the C source
files that pass filter_func."""
@@ -304,6 +314,9 @@ def main(platform):
stdout=err_data)
crypto_c_files.append('err_data.c')

test_support_cc_files = FindCFiles(os.path.join('src', 'crypto', 'test'),
AllFiles)

test_c_files = FindCFiles(os.path.join('src', 'crypto'), OnlyTests)
test_c_files += FindCFiles(os.path.join('src', 'ssl'), OnlyTests)

@@ -312,6 +325,7 @@ def main(platform):
'ssl': ssl_c_files,
'tool': tool_cc_files,
'test': test_c_files,
'test_support': test_support_cc_files,
}

asm_outputs = sorted(WriteAsmFiles(ReadPerlAsmOperations()).iteritems())


Loading…
Cancel
Save