diff options
author | David Benjamin <davidben@chromium.org> | 2015-05-12 03:52:48 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-05-12 04:06:32 +0300 |
commit | 2607383e72d2db3699f46d8b56812f881e5bc9b7 (patch) | |
tree | a3272f4804f55f2d3f7f95fca1f3de3614e6817c /util | |
parent | af3d5bd5a4895ce269ff73f0f1f688f8f410842e (diff) |
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>
Diffstat (limited to 'util')
-rw-r--r-- | util/generate_build_files.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/util/generate_build_files.py b/util/generate_build_files.py index 94de5460..e534a566 100644 --- a/util/generate_build_files.py +++ b/util/generate_build_files.py @@ -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()) |