Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build-script] When building with asan, mangle asan into the build subdirectory name. #8169

Merged
merged 1 commit into from Mar 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions utils/swift_build_support/swift_build_support/workspace.py
Expand Up @@ -85,4 +85,7 @@ def compute_build_subdir(args):
build_subdir += "+swift-" + swift_build_dir_label
build_subdir += "+stdlib-" + swift_stdlib_build_dir_label

# IF we have asan enabled, mangle it into the build directory name.
if args.enable_asan:
build_subdir += "+asan"
return build_subdir
13 changes: 10 additions & 3 deletions utils/swift_build_support/tests/test_workspace.py
Expand Up @@ -50,7 +50,7 @@ def test_workspace(self):

class ComputeBuildSubdirTestCase(unittest.TestCase):

def create_basic_args(self, generator, variant, assertions):
def create_basic_args(self, generator, variant, assertions, enable_asan=False):
return argparse.Namespace(
cmake_generator=generator,
cmark_build_variant=variant,
Expand All @@ -61,7 +61,14 @@ def create_basic_args(self, generator, variant, assertions):
cmark_assertions=assertions,
llvm_assertions=assertions,
swift_assertions=assertions,
swift_stdlib_assertions=assertions)
swift_stdlib_assertions=assertions,
enable_asan=enable_asan)

def test_Ninja_ReleaseAssert_asan(self): # noqa (N802 function name should be lowercase)
args = self.create_basic_args(
"Ninja", variant="Release", assertions=True, enable_asan=True)
self.assertEqual(compute_build_subdir(args),
"Ninja-ReleaseAssert+asan")

def test_Ninja_ReleaseAssert(self): # noqa (N802 function name should be lowercase)
# build-script -R
Expand Down Expand Up @@ -132,7 +139,7 @@ def test_all_combinations_are_unique(self):

def generate():
for c in productions:
args = argparse.Namespace(cmake_generator="Ninja")
args = argparse.Namespace(cmake_generator="Ninja", enable_asan=False)
for key, val in zip(keys, c):
setattr(args, key, val)
yield compute_build_subdir(args)
Expand Down